>>>>> "Peter" == =?ISO-8859-1?Q?Peter Str=F6mberg?= <ISO-8859-1>
Peter> Den 28 Sep 99, klockan 18:09
Peter> skrev Matthias Urlichs om (Re: About ISO week # formatting in ):
>> Peter Strömberg:
>> > Well, I would prefer that week('1982-01-01',1) should return the same value
>> > as week('1981-12-31',1) because they belong to the same week (which is 53)
>> Hmm, yes, but then you can't reasonably sort by the week number any more.
Peter> How to differ week 52 in the begining of a year and week 52 at the end of a
Peter> Maybe a new function, yearweek() who returns year of week and week:
Peter> yearweek('1981-12-31',1) = 198153
Peter> yearweek('1982-01-01',1) = 198153
Peter> yearweek('1982-12-31',1) = 198252
Peter> yearweek('1983-01-01',1) = 198252
Peter> compared to:
Peter> week('1981-12-31',1) = 53
Peter> week('1982-01-01',1) = 0
Peter> week('1982-12-31',1) = 52
Peter> week('1983-01-01',1) = 0
Peter> Then one could use yearweek() to sort data which is in different years.
Yes, the right way to fix this is to introduce a new function.
(The problem is that WEEK() in ODBC is defined to only return the week
number, so we can't fix the WEEK() function)
I shall put this on your TODO.