Home » Developer & Programmer » Forms » how to get starting date of the particular selected week no (oralce 9i)
icon4.gif  how to get starting date of the particular selected week no [message #386202] Fri, 13 February 2009 02:16 Go to next message
mohaninforakle
Messages: 55
Registered: January 2009
Member


hi experts,

Am new to forms,i have a query that is based on week no selection how could i get the starting date of the week.for example week no(1-53) i will select 3 then i should get 15.jan.2009 like this
Plese help me on this.

thanks in advance.Waiting for your reply.
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 Go to previous message
Littlefoot
Messages: 20896
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):

./fa/5719/0/

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?
Previous Topic: :system.record_status
Next Topic: how to insert picture from form 10g in database
Goto Forum:
  


Current Time: Tue Dec 06 02:24:26 CST 2016

Total time taken to generate the page: 0.12586 seconds