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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL SQL - how to get the first day of the week

Re: PL SQL - how to get the first day of the week

From: Thomas Reinartz <Thomas.Reinartz_at_debis.com>
Date: 2000/05/08
Message-ID: <8f753j$bsd$1@news.sns-felb.debis.de>#1/1

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

Original text of this message

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