Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01839: date not valid for month specified
Since you are applying the to_date() function to your test_dt column, I presume it is not defined as DATE but as VARCHAR2() or CHAR()? Which means that no validity check was performed by Oracle on insert. Quite obviously, your column contains some wrong data, something like a 30th February or 31st June - just what the message says. By the way, since, once again, you do not specify any date format in to_date(), I understand that the date is supposed to follow your default date format. In that case, do not apply a to_date() function on both sides of the equality, just express the constant as a string in the 'good' (i.e. default) date format. What you have written would prevent Oracle from using the index if the column is indexed.
Regards,
Stéphane Faroult
Oriole Corporation
![]() |
![]() |