List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 14 2002 4:58pm
Subject:Re: WEEK() returns wrong week number at start of year
View as plain text  
At 11:10 +0000 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 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.
>	SELECT WEEK(SUBDATE("2002-01-07 03:30:00", INTERVAL 4 DAY), 1);

I'd expect that.  This date occurs at the beginning of 2002.

Thread
WEEK() returns wrong week number at start of yeartrevor hemsley14 Jan
  • Re: WEEK() returns wrong week number at start of yearPaul DuBois14 Jan