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.
If expression is a character or graphic string, it must not be a CLOB or DBCLOB and its value must be a valid string representation of a date or timestamp. For the valid formats of string representations of dates and timestamps, see String representations of datetime values.
The result of the function is a large integer. If the argument can be null, the result can be null; if the argument is null, the result is the null value.
SELECT WEEK_ISO(PRENDATE) INTO :WEEK FROM PROJECT WHERE PROJNO = 'AD3100'Results in WEEK being set to 5.
SELECT DATE_1, WEEK_ISO(DATE_1) FROM XResults in the following:
1997-12-28 52 1997-12-31 1 1998-01-01 1 1999-01-01 53 1999-01-04 1 1999-12-31 52 2000-01-01 52 2000-01-03 1
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.