Invalid Date Stored In Oracle - Any Guesses ?

From: GaudaPrime <aejhfraser_at_hotmail.com>
Date: 6 Mar 2005 12:43:37 -0800
Message-ID: <1110141817.523639.132300_at_o13g2000cwo.googlegroups.com>



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 Received on Sun Mar 06 2005 - 21:43:37 CET

Original text of this message