Invalid Date Stored In Oracle - Any Guesses ? -
03-06-2005
, 02:43 PM
Hi,
I have an Oracle 8i instance which has somehow managed to store the
29th of February 2005 in a date field. As 2005 isn't a leap year this
is an invalid date.
SQL> select NEXTTRIG_DATE, lst_date from mc.tsklnk
where NEXTTRIG_DATE between '28-FEB-05' and '01-MAR-05'
and lst_date = '29-FEB-04'
order by NEXTTRIG_DATE
/
NEXTTRIG_ LST_DATE
--------- ---------
29-FEB-05 29-FEB-04
29-FEB-05 29-FEB-04
29-FEB-05 29-FEB-04
Selecting to_date(NEXTTRIG,yyyy) produces 0000, which I guess means the
to-date is crashing internally
While I can and have fixed the problem, I'd love to know how one would
be able to do this anyway - seeing as I can't duplicate the problem.
The information was stored by a third party ERP application via Oracle
ODBC, so I can't tell what it did - any suggestions ? So far the
application itself and MS Query have collapsed trying to read the date
(I'm guessing they do their own validation), so it's quite interesting
....
Any ideas ?
Andrew |