Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: PL SQL - how to get the first day of the week
Hi Carsten,
try this one (looks a bit complicated - sorry):
select
to_date(to_char(to_number(to_char(to_date('09-05-2000','DD-MM-YYYY'),
'DDD'))-to_number(to_char(to_date('09-05-2000','DD-MM-YYYY'), 'D'))+1),
'DDD')
from dual
/
Replace '09-05-2000' with any date you want. Oh, and if your week starts on Sunday - forget the +1.
Viele Grüße aus Düsseldorf
Thomas Received on Mon May 08 2000 - 00:00:00 CDT