× 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.



Rob,

I beg to differ: according to ISO standards it's week 1.

Hence the SQL function week_ISO.

Peter Colpaert
Application Developer
PLI - IT - Kontich, Belgium
-----
Yoda of Borg are we.  Futile is resistance, assimilated will you be.
-----



rob@xxxxxxxxx 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
15/03/2007 15:37
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Calculating The Number Of The Week






According to ISO standards it probably is week 53.
STRSQL
SELECT WEEK('2007-12-31') FROM SYSIBM/SYSDUMMY1
yields 53 for 2006, 2007
Look at your calendar and count it up also, if 01/01 is the start of week 
1 then 12/31 would be in the 53rd week.
365/7=52.something not 52 even.
12/29/2007 is in week 52, 12/30/2007 is in week 53

For an easy to understand RPG solution try this free format sql v5r4 
statement
exec sql values week(:MyDateField) into :MyWeekNumber;

Rob Berendt




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.