MySQL Forums
Forum List  »  Docs

YearWeek() addition to documentation
Posted by: M. G.
Date: September 03, 2009 05:58AM

To my delight I found that the YearWeek(some_date) does maintain continuality across year boundaries. A week which starts on the previous year but ends in the next year is kept as a single week. This is great when one wants to aggregate daily data into weekly data. (e.g.,…GROUP BY YEARWEEK(TRANSACTION_DATE)…)
This behavior is not documented. I think it should!
(BTW, if one does not like this behavior and would like to split the week into separate years he/she can use the WEEK() function. Shouldn't this be documented too?)

Options: ReplyQuote

Written By
YearWeek() addition to documentation
September 03, 2009 05:58AM
October 02, 2009 03:31PM
October 03, 2009 07:26AM
October 30, 2009 06:36AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.