Message-Id: <10701.123699@fatcity.com> From: "andrey" Date: Tue, 5 Dec 2000 20:35:37 +0200 Subject: REVIEWED: group by week This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C05EFA.ED12EF90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Dear list ! Is there a function which converts a week number into a date of the first day of the week ? For example , this week is week number 49 in the year 2000 . I need a function that will give me '03-DEC-2000' ( last sunday ) as an output . Thanks a lot ! Andrey . -----Original Message----- From: andrey [mailto:bronfin@visualtop.com] Sent: Tue, December 05, 2000 8:23 PM To: oralist@lists; ORACLE-L@IC.SUNYSB.EDU; ORACLE-L@fatcity.com; oracledba@quickdoc.co.uk; oracledba@lazydba.com Subject: group by week Dear list ! I have a table AAA with fields (registration_date , status ) . I need a report which will group the results by week . I.e instead of select to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')), count(status) from AAA group by to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')); I need something like select first_date_in_the_week(REGISTRATION_DATE) , count(status) from AAA group by week_of ( REGISTRATION_DATE ) ; Any ideas ? ------=_NextPart_000_000D_01C05EFA.ED12EF90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear=20 list !
 
Is=20 there a function which converts a week number into a date of the first = day of=20 the week ?
For=20 example , this week is week number 49 in the year 2000 = .
I need=20 a function that will give me '03-DEC-2000'  ( last sunday ) as an = output=20 .
 
Thanks=20 a lot !
 
Andrey=20 .
-----Original Message-----
From: andrey=20 [mailto:bronfin@visualtop.com]
Sent: Tue, December 05, 2000 = 8:23=20 PM
To: oralist@lists; ORACLE-L@IC.SUNYSB.EDU; = ORACLE-L@fatcity.com;=20 oracledba@quickdoc.co.uk; oracledba@lazydba.com
Subject: = group by=20 week

Dear = list=20 !
 
I = have a table AAA=20 with fields (registration_date , status ) .
I = need a report=20 which will group the results by week .
 
I.e = instead of=20
   =20 select to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY')), = count(status)=20
   =20 from AAA
   group=20 by = to_date(to_char(REGISTRATION_DATE,'DD-MON-YYYY'));
 
 
I = need something=20 like
 =20 select  first_date_in_the_week(REGISTRATION_DATE) , count(status) =
   =20 from AAA
   group=20 by week_of (   REGISTRATION_DATE )=20 ;
 
 
Any =