Skip to content

Personal tools
You are here: Home » DB2 » DB2 Mainframe Articles Archive » Q&As on Dates and DB2 » WEEK_ISO description
Seeking new owner for this high-traffic site.
Tap into the potential of this DBA community to expand your business! Interested? Contact us today.
Who Are You?
I am a:
Mainframe True Believer
Distributed Fast-tracker

[ Results | Polls ]
Votes : 3443


Above in this comment thread: Q&As on Dates and DB2

WEEK_ISO description

Posted by SenGa at 2006-07-12 08:23 AM
WEEK_ISO definition is "Converts a date, timestamp, or string representation of a date or timestamp into an integer that represents the week within the year (with Monday as the first day of the week)."
I think (but may be wrong) that it's not the main difference: for me, WEEK_ISO starts the first week of the year on the first Thursday while WEEK starts the first week on the first day of the year.
For exemple, the 2005/01/01 gives week 53 using WEEK_ISO and week 1 using WEEK. Moreover, the difference between the week starting on Monday or Sunday makes the 2005/02/06 being in week 5 (WEEK_ISO) or 7 (WEEK).
The main problem I have is to determined the year on which the week is based. Using the 2005/01/01 with WEEK_ISO to get a date formated YYYY-WW-DD (Year-Week-DayOfWeek), the Year should be 2004 as the Week is 53, but there is no (as far as I know) function to get this Year?

DB2 in rexx

Posted by sundsara at 2007-08-02 02:44 AM
How do we get a data from db2 table using rexx tool
Transaction Management
Reduce downtime and increase repeat sales by improving end-user experience.
Free White Paper
Database Recovery
Feeling the increased demands on data protection and storage requirements?
Download Free Report!

Powered by Plone