Home » RDBMS Server » Server Administration » format date field
format date field [message #374935] Thu, 12 July 2001 07:00 Go to next message
serdar
Messages: 4
Registered: July 2001
Junior Member
I need to format a date to return dd-month-yyyy, e.g. 28-July-2001
The original format is 2001-07-28 00:00:00.00
Re: format date field [message #374936 is a reply to message #374935] Thu, 12 July 2001 07:05 Go to previous messageGo to next message
Stephen
Messages: 26
Registered: January 2000
Junior Member
select to_date(fieldname,'DD-MONTH-YYYY')
from table
where ...
Re: format date field [message #374938 is a reply to message #374935] Thu, 12 July 2001 07:15 Go to previous message
GIRIDHAR KODAKALLA
Messages: 92
Registered: May 2001
Member
Hai Serdar,

SQL> SELECT TO_CHAR(TO_DATE('2001-07-28 00:00:00','YYYY-MM-DD HH24:MI:SS'),'DD-MONTH-YYYY') MY_DATE
2 from dual;

MY_DATE
-----------------
28-JULY -2001

If we want to eliminate the space after july, i think there is one command something like Fm or something.
I dont remember it exactly. That will help you to format it properly.Kindly check the documentation for that.

Regards,
Giridhar Kodakalla
Previous Topic: format date field
Next Topic: convert minutes to hours and minutes
Goto Forum:
  


Current Time: Wed Jul 03 02:41:40 CDT 2024