tags:

views:

53

answers:

1

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?

+1  A: 
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)...

Joe Hopfgartner