Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Expression needed
"MAB" <bad-email_at_nowhere.com> wrote in message news:<2mv4i5Frkl64U1_at_uni-berlin.de>...
> What's the expression to convert strings of the type '28-JUL-04' to
> '2004/07/28' ?
>
> thx
Well you could convert the string to a date via to_date and then convert the date to character string via to_char something like
UT1 > select to_char(to_date('28-Jul-04'),'YYYY/MM/DD') from dual;
TO_CHAR(TO
Or since you have a string to begin with and just want to rearrange it you could use substr and concatenation, but if the data is a date then conversion to and back from a date is best. If the data is stored as an Oracle date datatype then you can output in just abount any format desired using to_char and a date format mask.
HTH -- Mark D Powell -- Received on Fri Jul 30 2004 - 14:05:06 CDT
![]() |
![]() |