Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: TO_CHAR PROBLEMS WITH FORMATING DATE INVALID NUMBER

Re: TO_CHAR PROBLEMS WITH FORMATING DATE INVALID NUMBER

From: Axel Seinsche <newsgroup_at_seinsche.net>
Date: Tue, 18 Feb 2003 11:23:06 +0100
Message-ID: <b2t1ha$evu$03$2@news.t-online.com>


Kev Baker wrote:
> Hi
>
> I wonder if anyone can help
>
> I am trying to format a date using to_char
>
> When I use sysdate to char works no problem.
>
> select to_char(sysdate,'MM/DD/YY') from dual;
>
>
> However when I cut and paste the date from the result of (select
> sysdate from dual) and then put that into the statement below I get an
> 'Invalid Number' error message.
>
> select to_char('18-FEB-2003 09:40:49','MM/DD/YY') from dual;
>
> Any ideas?
>
> Thanks

You have to nest a to_date for your date '18-FEB-2003 ...' and then it should work.
select to_char(to_date('18-FEB-2003 09:40:49', 'DD-MON-YYYY HH24:MI:SS'),'MM/DD/YY') from dual;

Axel Received on Tue Feb 18 2003 - 04:23:06 CST

Original text of this message

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