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: SQL for date conversion

Re: SQL for date conversion

From: Spencer <spencerp_at_swbell.net>
Date: Sun, 11 Feb 2001 08:04:19 -0600
Message-ID: <nZwh6.172$ZO2.10023@nnrp1.sbc.net>

i would do this by first converting the string to a date value:

TO_DATE( '09/19/99' ,'MM/DD/RR') then convert the date value back to a string:

TO_CHAR( <dateexpr> , 'Month DD, YYYY')

putting it all together, it would look like this:

TO_CHAR(TO_DATE( '09/19/99' ,'MM/DD/RR'), 'Month DD, YYYY')

note that this will throw an exception if the input string cannot be converted to a valid date value. and you may need to modify the format string on the to_char function. i'll leave the details of the date format strings for you to lookup in the documentation.

HTH <mem55_at_my-deja.com> wrote in message news:964rl0$2j2$1_at_nnrp1.deja.com...
> Hello,
>
> How would I change the format of 09/12/99 to September 12, 1999 in SQL?
> Would I use to_char to to_date?
>
> I appreciate the help. Thanks.
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Sun Feb 11 2001 - 08:04:19 CST

Original text of this message

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