?
Solved

date format in sql plus.

Posted on 2003-10-29
4
Medium Priority
?
41,183 Views
Last Modified: 2007-12-19
i want to change the format of a date using the function:TO_CHAR OR TO_DATE  to this format:
from dd-mm-yyyy
to: month, date(th) yyyy
ex: january, seventeenth 2003.
0
Comment
Question by:jheff
4 Comments
 
LVL 12

Expert Comment

by:catchmeifuwant
ID: 9640810

select to_char(sysdate,'fmMonth')||','||to_char(sysdate,'fmDDspth')||' '||to_char(sysdate,'YYYY') from dual
0
 
LVL 7

Expert Comment

by:Bigfam5
ID: 9640914
Even though catchmeifuwant is correct, let me point out the case sensitivity issue with formatting dates:

to_char(sysdate, 'fmMonth') = January
to_char(sysdate, 'fmmonth') = january
to_char(sysdate, 'fmMONTH') = JANUARY

to_char(sysdate, fmDDspth') = SEVENTEENTH
to_char(sysdate, fm'Ddspth') = Seventeenth
to_char(sysdate, fm'ddspth') = seventeenth


0
 
LVL 7

Accepted Solution

by:
grim_toaster earned 150 total points
ID: 9649417
Or you can do it all in one to_char call:

SELECT TO_CHAR(SYSDATE, 'fmMonth, fmDdspth YYYY') FROM dual
0
 

Expert Comment

by:NadirMaroof
ID: 10289836
i want to add date in a column of my table in "DD/Mon/YYYY" format, what sort of check should i introduce to ensure this behavior ?
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question