Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date question

Re: Date question

From: Andrew Protasov <oracle_at_protasov.kiev.ua>
Date: Fri, 11 Dec 98 21:50:29 +0200
Message-ID: <AG5UNSsK42@protasov.kiev.ua>

Hi,

If you have week number (50 in the sample) then you can subtract 1 from this number, multiply by 7, add sum to the first day of the year and truncate result with 'day' format mask to obtain first day of the week. Add 6 to the previous result in order to obtain week end.

SVRMGR> select trunc(to_date('01.01.1998','dd.mm.yyyy')+7*49,'day') from dual; TRUNC(TO_



06-DEC-98
1 row selected.
SVRMGR> select trunc(to_date('01.01.1998','dd.mm.yyyy')+7*49,'day')+6 from dual;

TRUNC(TO_



12-DEC-98
1 row selected.

Andrew Protasov

> Hi,
>
> Can anyone tell me how can I obtain the first and the last day of any
> week in the year ?
>
> Thanks,
>
> Marco
>
>
>
Received on Fri Dec 11 1998 - 13:50:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US