The MAKEDATE() function in MySQL is used to create a date from a given year and day of the year. The function takes two arguments:
year: The year in which the date should be created.dayofyear: The day of the year (from 1 to 366).
The syntax is:
MAKEDATE(year, dayofyear)
Example:
SELECT MAKEDATE(2024, 23);
This will return the date 2024-01-23, as it's the 23rd day of the year 2024.
Notes:
- The
dayofyearshould be between 1 and 366 (since 366 days are possible in a leap year). - If the
dayofyearexceeds the valid range for the given year, the function will returnNULL.
No comments:
Post a Comment