May 2005
Intermediate to advanced
352 pages
14h 39m
English
YEARWEEK( )
YEARWEEK(date[,value])
This function returns the year coupled with the number of the week into the year: yyyyww. By default, the first day of the week is Sunday and the basis of the calculation. Optionally, you can set this to Monday as the first day of the week by entering a value of 1 for the second argument.
SELECT YEARWEEK('2005-01-07')
AS 'YearWeek';
+----------+
| YearWeek |
+----------+
| 200501 |
+----------+This function may be useful in
conjunction with the PERIOD_ADD( ) and
PERIOD_DIFF( ) functions.
Read now
Unlock full access