Home » SQL & PL/SQL » SQL & PL/SQL » Urgent Help required on Oracle Date Formats
Urgent Help required on Oracle Date Formats [message #223270] Thu, 08 March 2007 04:03 Go to next message
AnilOrafaq
Messages: 12
Registered: May 2006
Junior Member
Dear All,
I have following requirement where i need to show

22-FEB-2007 falls on 3rd Week of Feb,2007
27-FEB-2007 falls on 4rd Week of Feb,2007

But,when i use following oracle week date format,i have the following.

SQL>>> SELECT TO_CHAR(TO_DATE('22-FEB-2007'),'W') FROM DUAL;

T
-
4

1 row selected.

SQL>>> SELECT TO_CHAR(TO_DATE('27-FEB-2007'),'W') FROM DUAL;

T
-
4

1 row selected.

So,do we have any workaround for this. Kindly help on this as this is required on urgent basis.
Re: Urgent Help required on Oracle Date Formats [message #223272 is a reply to message #223270] Thu, 08 March 2007 04:14 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
You are wrong, according to the definition of the "W" format mask:

SQL Reference
Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh.
This is not true.
1-7 = week 1
8-14 = week 2
15-21 = week 3
22-28 = week 4
...

Do you have your own definition of weeks? Perhaps you are looking for something else?

MHE
Previous Topic: count function
Next Topic: function returned without value error
Goto Forum:
  


Current Time: Wed Dec 07 04:57:56 CST 2016

Total time taken to generate the page: 0.12143 seconds