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

Home -> Community -> Usenet -> c.d.o.server -> Re: Find First of Month

Re: Find First of Month

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Thu, 13 Jul 2006 22:27:45 +0100
Message-ID: <eeedb2lnnv0v0ij3bnmk01f1vope0107ep@4ax.com>


On 13 Jul 2006 13:25:52 -0700, "FireGeek" <firegeek822_at_hotmail.com> wrote:

>Is there a way to determine what week a particular date is?
>Considering a calendar year is 52 weeks, I am looking at finding what
>week say 07/10/2006 is (which would be week 28).

 Not all dates count as being within 52 weeks, some are in week 53. Either the 'WW' or 'IW' date formats are probably what you're after:

SQL> select to_char(to_date('07/10/2006', 'MM/DD/YYYY'), 'WW'),   2 to_char(to_date('07/10/2006', 'MM/DD/YYYY'), 'IW')   3 from dual;

TO_CHAR(TO_DATE('07/10/2006',' TO_CHAR(TO_DATE('07/10/2006','

------------------------------ ------------------------------
28                             28

 See the docs for how they're different. Also remember that 07/10/2006 is ambiguous; not everyone uses the American date format.

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Thu Jul 13 2006 - 16:27:45 CDT

Original text of this message

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