|
Re: how to get starting date of the particular selected week no [message #386280 is a reply to message #386202] |
Fri, 13 February 2009 07:12  |
 |
Littlefoot
Messages: 21826 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Huh? On my calendar, week 3 starts on Monday, 12.01.2009 (dd.mm.yyyy):

If that's correct, then such a query might do the job:
SQL> select min(t.dt) week_begins_on
2 from (select trunc(sysdate, 'yyyy') + level - 1 dt
3 from dual
4 connect by level <= 366
5 ) t
6 where to_char(t.dt, 'iw') = lpad(&week, 2, '0');
Enter value for week: 3
WEEK_BEGINS_ON
-------------------
12.01.2009 00:00:00
SQL> /
Enter value for week: 9
WEEK_BEGINS_ON
-------------------
23.02.2009 00:00:00
SQL>
I'm not saying that this is the best possible solution, but - might give you an idea.
By the way, what calendar do you use so that the 3rd week starts on Thursday, Jan 15th 2009?
|
|
|