Subject Re: Casting a Date to a Varchar inverts its format?
Author legrand_legrand_63
> What I need is this:
>
> "01-01-2006 09:21"
>
> What am I missing here and how can I accomplish what I need?
>
> Thanks,
>
> -Benton
>
Hello,

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