Reputation: 441
In IBM DB2, using only SQL, I would like to obtain a Sunday Date and a Monday Date using the YEAR and WEEK NUMBER.
I am new to IBM DB2.
Upvotes: 2
Views: 3715
Reputation: 441
Assuming n_year
is the year, and n_week_in_year
is the ISO week number in that year, I used the following function:
(DATE(((n_week_in_year-1)* 7)+ 1) + (n_year -1) years)
I get the Monday date for that week.
My response is based on reading the following article: CodeNaut: Calculate Date for any given week in year
Upvotes: 3