Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: VARCHAR2 to DATE Conversion Error
Good thinking but what about
select to_char(to_date('August 03rd 2002', 'Month DD"th"
YYYY'),'DD-MON-YYYY')
from dual
or
select to_char(to_date('August 01st 2002', 'Month DD"th"
YYYY'),'DD-MON-YYYY')
from dual
Or in a general case
select to_char(to_date(a_date_column, 'Month DD"th" YYYY'),'DD-MON-YYYY') from a_table
will produce the ORA-01861: literal does not match format string error when August 01st 2002 encountered etc.
"misha-kostromich" <bronshvayg_at_yahoo.com> wrote in message
news:c6c2b410.0208090648.224d0ae0_at_posting.google.com...
> Try this one:
> select to_char(to_date('August 10th 2002', 'Month DD"th"
YYYY'),'DD-MON-YYYY')
> from dual
>
>
>
> "Epicentre Team B Annecy" <carmanet_at_epicentre.fr> wrote in message
news:<aj05s4$otj$1_at_wanadoo.fr>...
> > Sorry Mr. M, I made a (big) mistake!
> >
> > I think the problem comes from spaces...
> > Try : "select TO_CHAR(SYSDATE, 'DAY DDTH MONTH YYYY') from dual", and
see
> > the result...
> >
> > Celine.
> >
> > "Mr. M" <mrm_at_nospamsorry.com> a écrit dans le message news:
> > 1028886620.23187.0.nnrp-08.c2d92da9_at_news.demon.co.uk...
> > > select to_char(to_date('August 10th 2002', 'Month DDth YYYY'),
> > > 'DD-MON-YYYY')
> > > from dual
> > >
> > > returns
> > >
> > > ERROR at line 1:
> > > ORA-01841: (full) year must be between -4713 and +9999, and not be 0
> > >
> > > Uhhh????
> > >
> > >
Received on Fri Aug 09 2002 - 11:20:19 CDT