Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: to_date function
SG wrote:
>
> I am not sure what I am doing wrong, but when I run this query:
>
> SQL> select to_date(11051946, 'MM-DD-YYYY') from dual;
> TO_DATE(11051946,'MM
>
> --------------------
>
> 05-NOV-46
>
> But, when I change the number 11051946 to 11451946, I get an error:
>
> SQL> select to_date(11451946, 'MM-DD-YYYY') from dual;
>
> TO_DATE(11451946,'MM
>
> --------------------
>
> ORA-01861: literal does not match format string
>
> Any ideas?
> thanks for the help
> SG
>
> 1 row selected.
11451946 is an invalid date - there are not 45 days in any November.
Also, try putting the first arg in single quotes.
-- Ron Reidy Oracle DBA Reidy Consulting, L.L.C.Received on Wed Nov 07 2001 - 11:42:02 CST