Re: first day of any given week
Date: Wed, 04 Apr 2001 14:59:51 GMT
Message-ID: <3ACB3421.7EE5F607_at_sympatico.ca>
Hi Peter,
I know there are a number of fairly esoteric date functions. One that comes to
mind (I don't have a reference book at the moment) is
NEXT_DAY(d,char)
It returns the date of the first weekday named by 'char' after the supplied date 'd'. For example,
SQL> SELECT NEXT_DAY('15-SEP-99','TUESDAY' ) 2 FROM DUAL; NEXT_DAY(
21-SEP-99 SQL>
This returns the date of the Tuesday following Sept 15, 99...it's not exactly what you asked for but...
Hth,
Steve
Peter Leijsten wrote:
> Hi all,
>
> I know that following query will retrieve the first day of the current week:
>
> select (trunc(sysdate,'w')+1) from dual;
>
> However, what I'm looking for s a query that will retrieve the first day of
> any given week (input = week number of the year).
>
> As far as I know you cannot use weeks as format code for a date
> specification.
>
> Any suggestions?
>
> thanks in advance,
>
> Peter Leijsten
Received on Wed Apr 04 2001 - 16:59:51 CEST