Friday 5 August 2016

MAKEDATE(): Return date



MAKEDATE() returns a date by taking a value of a year and a number of days. The number of days must be greater than 0 other wise a NULL will be returned.

mysql> SELECT MAKEDATE(2016, 234);
+---------------------+
| MAKEDATE(2016, 234) |
+---------------------+
| 2016-08-21          |
+---------------------+
1 row in set (0.00 sec)
 
mysql> SELECT MAKEDATE(2016, -10);
+---------------------+
| MAKEDATE(2016, -10) |
+---------------------+
| NULL                |
+---------------------+
1 row in set (0.00 sec)

mysql> SELECT MAKEDATE(2016, 0);
+-------------------+
| MAKEDATE(2016, 0) |
+-------------------+
| NULL              |
+-------------------+
1 row in set (0.00 sec)







Previous                                                 Next                                                 Home

No comments:

Post a Comment