Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TO_CHAR PROBLEMS WITH FORMATING DATE INVALID NUMBER
>>>>> "Kev" == Kev Baker <kev_at_wwwatt.co.uk> writes:
Kev> Hi I wonder if anyone can help
Kev> I am trying to format a date using to_char
Kev> When I use sysdate to char works no problem.
Kev> select to_char(sysdate,'MM/DD/YY') from dual;
Kev> However when I cut and paste the date from the result of (select Kev> sysdate from dual) and then put that into the statement below I Kev> get an 'Invalid Number' error message.
Kev> select to_char('18-FEB-2003 09:40:49','MM/DD/YY') from dual;
Kev> Any ideas?
Yes, you are using a string representation of a date when to_char() is expecting an oracle date object.
What are you expecting/wanting with a line like that?
Are you wanting to convert a string date into another string date? If so, perhaps
select to_char(to_date('18-FEB-2003 09:40:49', 'DD-MON-YYYY HH24:MI:SS'), 'MM/DD/YY') from dual;
will do what you want.
Tim
-- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out!Received on Wed Feb 19 2003 - 01:43:54 CST