Declaration
MAKEDATE(year,dayofyear)
Description
Returns the date value for the specified year and dayofyear. The value of dayofyear must be greater than 0; otherwise, NULL is returned.
If dayofyear is greater than 366, the excess value is added to the year specified by year. If the resulting year exceeds 9999, the function returns NULL.
Examples
obclient> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);
+-------------------+-------------------+
| MAKEDATE(2011,31) | MAKEDATE(2011,32) |
+-------------------+-------------------+
| 2011-01-31 | 2011-02-01 |
+-------------------+-------------------+
1 row in set
obclient> SELECT MAKEDATE(2011,0);
+------------------+
| MAKEDATE(2011,0) |
+------------------+
| NULL |
+------------------+
1 row in set
obclient> SELECT MAKEDATE(2011,2917923);
+------------------------+
| MAKEDATE(2011,2917923) |
+------------------------+
| NULL |
+------------------------+
1 row in set