Subject | Re: Casting a Date to a Varchar inverts its format? |
---|---|
Author | legrand_legrand_63 |
Post date | 2006-12-08T19:14:49Z |
> What I need is this:Hello,
>
> "01-01-2006 09:21"
>
> What am I missing here and how can I accomplish what I need?
>
> Thanks,
>
> -Benton
>
If you want to accomplish this in SQL, you should try to convert your
date to string using :
cast(extract(day from invoicedate) as char(2))
||'-'|| cast(extract( month from invoicedate) as char(2))...
you can also try to use an UDF like DATETOSTR(invoicedate,'%d-%m-%Y')
found at http://rfunc.sourceforge.net/
or TO_CHARD(invoicedate,'DD-MM-YYYY) from http://perso.orange.fr/Udf4ORA/
Regards
PAscal