List:General Discussion« Previous MessageNext Message »
From:Aldrian Gintingsuka Date:April 26 1999 7:57am
Subject:Re: Week in year before 1998 starts from 1 instead of 0
View as plain text  
Thanks for the reply. I would expect the same situation for 1996 and 1997.
However, mysql returns 1, instead of 0, for the first day of 1997.

mysql> select week('1996-01-01');
+--------------------+
| week('1996-01-01') |
+--------------------+
|                  1 |
+--------------------+
1 row in set (0.00 sec)

mysql> select week('1996-12-31');     
+--------------------+
| week('1996-12-31') |
+--------------------+
|                 53 |
+--------------------+
1 row in set (0.01 sec)

mysql> select week('1997-01-01');       
+--------------------+
| week('1997-01-01') |
+--------------------+
|                  1 |
+--------------------+
1 row in set (0.00 sec)

========================================================================
Aldrian Gintingsuka -- Systems Consultant -- Mitra Integrasi Informatika
Phone: +62-21-251-1360 ext. 1414 -- Fax: +62-21-251-2748
Email: aldrian@stripped, aldrian@stripped
------------------------------------------------------------------------
Si tu es contre Dieu, tu es contre l'homme (Enigma: Sadeness part I)



On Sun, 25 Apr 1999, Michael Widenius wrote:

monty> Hi!
monty> 
monty> The above is actually correct!
monty> 
monty> 1998-01-01 is week 53 of 1997.  Instead of returning 53, we thought it 
monty> would be better to return 0, as 53 could easily be confused with the
monty> last week of the year.
monty> 
monty> The only 'right' solution would be if WEEK() returned the week in format:
monty> 
monty> YYYY-WW
monty> 
monty> but this would break ODBC applications.
monty> 
monty> (Sorry, but for the moment I can't check what other SQL servers
monty> returns in this case)
monty> 




Thread
Week in year before 1998 starts from 1 instead of 0aldrian23 Apr
  • Week in year before 1998 starts from 1 instead of 0Michael Widenius26 Apr
    • Re: Week in year before 1998 starts from 1 instead of 0Aldrian Gintingsuka26 Apr
      • Re: Week in year before 1998 starts from 1 instead of 0Michael Widenius27 Apr
        • Re: Week in year before 1998 starts from 1 instead of 0Aldrian Gintingsuka27 Apr
          • Re: Week in year before 1998 starts from 1 instead of 0Michael Widenius27 Apr