Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Find First of Month
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 toolReceived on Thu Jul 13 2006 - 16:27:45 CDT
![]() |
![]() |