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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: REVIEWED: group by week

RE: REVIEWED: group by week

From: Dara Vaughn <dara.vaughn_at_wcom.com>
Date: Tue, 05 Dec 2000 13:38:53 -0600
Message-Id: <10701.123714@fatcity.com>


This is a multi-part message in MIME format.

--Boundary_(ID_f0GePPJfYbubJH/8taGujw)
Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit

Andrey,

Try this:

select trunc(to_date(to_char( &week_of_year * 7) || '/' || to_char(sysdate,'YYYY'),'DDD/YYYY'),'IW')-1 from dual;

Modify accordingly!

Dara Vaughn
Oracle DBA
Quality Software Engineering
  -----Original Message-----
  From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of andrey   Sent: Tuesday, December 05, 2000 12:37 PM   To: Multiple recipients of list ORACLE-L   Subject: REVIEWED: group by week

    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 .

--Boundary_(ID_f0GePPJfYbubJH/8taGujw)
Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">

<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000>Andrey,</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D538033519-05122000>Try=20
this:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D538033519-05122000>select=20
trunc(to_date(to_char( &amp;week_of_year * 7) || '/' ||=20 to_char(sysdate,'YYYY'),'DDD/YYYY'),'IW')-1</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000>from&nbsp;&nbsp;&nbsp; = dual;</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D538033519-05122000>Modify=20
accordingly!</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D538033519-05122000>Dara=20
Vaughn</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D538033519-05122000>Oracle=20
DBA</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D538033519-05122000>Quality Software = Engineering</SPAN></FONT></DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader><FONT face=3D"Times New Roman"=20   size=3D2>-----Original Message-----<BR><B>From:</B> root_at_fatcity.com=20   [mailto:root_at_fatcity.com]<B>On Behalf Of</B> andrey<BR><B>Sent:</B> = Tuesday,=20
  December 05, 2000 12:37 PM<BR><B>To:</B> Multiple recipients of list=20   ORACLE-L<BR><B>Subject:</B> REVIEWED: group by = week<BR><BR></DIV></FONT>
  <BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">     <DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT = face=3DTahoma=20

    size=3D2><BR></DIV></FONT>
    <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000>Dear list !</SPAN></FONT></DIV>     <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000></SPAN></FONT>&nbsp;</DIV>     <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN = class=3D076173218-05122000>Is=20

    there a function which converts a week number into a date of the = first day=20

    of the week ?</SPAN></FONT></DIV>
    <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000>For example , this week is week number 49 = in the=20

    year 2000 .</SPAN></FONT></DIV>
    <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN = class=3D076173218-05122000>I=20

    need a function that will give me '03-DEC-2000'&nbsp; ( last sunday = ) as an=20

    output .</SPAN></FONT></DIV>
    <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000></SPAN></FONT>&nbsp;</DIV>     <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000>Thanks a lot !</SPAN></FONT></DIV>     <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000></SPAN></FONT>&nbsp;</DIV>     <DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20     class=3D076173218-05122000>Andrey=20 Received on Tue Dec 05 2000 - 13:38:53 CST

Original text of this message

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