I have the week number and year as separate fields in MySQL, how do I compute the last day of the week(Sunday) in the given year?
Asked
Active
Viewed 205 times
0
-
1See [this](http://stackoverflow.com/questions/3317980/getting-first-day-of-the-week-in-mysql-using-week-no) or [this](http://stackoverflow.com/questions/3707347/mysql-week-date-range-from-week-number-in-a-query)... – pascal Sep 22 '10 at 08:08
1 Answers
1
SELECT STR_TO_DATE('201038 Sunday', '%X%V %W');
This gives you sunday of the current week (38/2010). I used sunday because the "last day" is not consistend. sometimes its sunday, sometimes saturday (week starts on monday)...

The Surrican
- 29,118
- 24
- 122
- 168