× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Walden,

It is working as intended. The V5R3 manual states:
"The WEEK_ISO function returns an integer between 1 and 53 that represents the week of the year. The week starts with Monday. Week 1 is the first week of the year to contain a Thursday, which is equivalent to the first week containing January 4. Thus, it is possible to have up to 3 days at the beginning of the year appear as the last week of the previous year or to have up to 3 days at the end of a year appear as the first week of the next year."

As this past Thursday was the 1st day of the year, the 29th is shown as week 1 (weird, I know).

The function you want to use is just "week":

select week(date('2008-12-29')) from sysibm/sysdummy1

Gives 53 as the answer (a more sensible result, if you ask me :-) )

Hope this helps.

Regards,

Luis Rodriguez

IBM Certified Systems Expert
eServer i5 iSeries Technical Solutions


--- On Tue, 1/6/09, midrange-l-request@xxxxxxxxxxxx <midrange-l-request@xxxxxxxxxxxx> wrote:
Week_ISO and the last week of 2008
Tuesday, January 6, 2009 1:48 PM
From: "Walden H. Leverich" <WaldenL@>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>>

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.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.