WEEK() returns wrong week number at start of year

2002-01-14 Thread trevor hemsley
Description: Run SELECT WEEK(SUBDATE(2002-01-07 03:30:00, INTERVAL 7 DAY), 1) and it wrongly returns 53. How-To-Repeat: SELECT WEEK(SUBDATE(2002-01-07 03:30:00, INTERVAL 7 DAY), 1); Fix: Correct result returned by querying the thursday of that week instead, ie.

Re: WEEK() returns wrong week number at start of year

2002-01-14 Thread Paul DuBois
At 11:10 + 1/14/02, trevor hemsley wrote: Description: Run SELECT WEEK(SUBDATE(2002-01-07 03:30:00, INTERVAL 7 DAY), 1) and it wrongly returns 53. Why is that incorrect? The date you have specified occurs on Dec. 31 of the previous year? How-To-Repeat: SELECT