I just found the following Wikipedia entry, which explains the rules and the
exceptions to the rules governing week 1 or 53 in a year:
http://en.wikipedia.org/wiki/ISO_week_date
According to that, '12/29/2008' is year 2009, week 1, weekday 1.
More info about ISO 8601 at
http://en.wikipedia.org/wiki/ISO_8601
In other words: User beware! If you are building an application that's based
on the ISO number of the week you will end up with (apparently) unexpected /
incorrect results. Be sure to also include an ISO - based calculation of the
year's value, so that a date like '12/29/2008' returning ISO-week '1'
doesn't throw your calculations in disarray ... that's because hidden behind
the week '1' value there is a year value of '2009'!
Which brings up the question: Is there a function YEAR_ISO ??? Or some other
function which returns the ISO year, week and weekday together? I couldn't
find any ...
Regards,
Ulrich Krueger
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Walden H. Leverich
Gesendet: Tuesday, 06. January 2009 18:48
An: Midrange Systems Technical Discussion
Betreff: Week_ISO and the last week of 2008
According to the spec week_iso should have returned 53 for the end of
2008. On V5R4 I'm getting 1. Can someone please try:
select week_iso(date('12/29/08')) from sysibm/sysdummy1
on their machine and let me know what they get.
Thanks,
-Walden
As an Amazon Associate we earn from qualifying purchases.