RE: Date conversion problems.
Posted in 1999
Topics: General Discussion
Yes I have. There are also similar problems with month intervals. Informix does not concider these errors though. > "29-02-2000" + 1 UNITS YEAR = "29-02-2001" which of course is not a > valid date. > "31-03-2000" + 1 UNITS MONTH = "31-04-2000" which is another invalid > date. > Informix says you must trap these errors and handle them yourself. They say they are following some ansi standard by treating date calculations like this. > ---------- > From: nayan jain[SMTP:nayan.jain@tatainfotech.com] > Sent: Wednesday, November 24, 1999 10:43 AM > To: Informix-List (E-mail) > Subject: Date conversion problems. > > > Hi all, > > I am back to this list after a long long time. > > There seems to be some problems with the date increment functions in > Informix Online 7.3 > > If i write a statement like this > > Let p_date = "29-02-2000" + 1 UNITS YEAR > > 29-02-2000 means 29th february 2000. > > It gives an error like > > ---------- > FORMS statement error number -1267. > The result of a datetime computation is out of range. > ---------- > > If i write this in sql then i get an error like this > > ------- > select date("29-02-2000") + 1 units year from dummy > # ^ > # 1267: The result of a datetime computation is out of range. > # > ------- > > Have anyone of u encountered the similar error. > > Also what is the reason and solution to this. > > Thanks in Advance > > With Regards > > Nayan Jain ! > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > "By working faithfully eight hours a day, you may eventually > get to be a boss and work twelve hours a day." >
Which date do you want to be one year later than 29th February 2000? 28th February 2001? 1st March 2001? 29th February 2004? You could give valid reasons for any of these (though the 2004 is perhaps the flimsiest reason). There is no one universally accurate answer, so rather than give what someone will regard as an incorrect answer, no answer is given. I will try not to respond to any more of these 'adding months and years to date' questions this week! "Howard, Paul" wrote: > Yes I have. There are also similar problems with month intervals. Informix > does not concider these errors though. > > > "29-02-2000" + 1 UNITS YEAR = "29-02-2001" which of course is not a > > valid date. > > "31-03-2000" + 1 UNITS MONTH = "31-04-2000" which is another invalid > > date. > > > Informix says you must trap these errors and handle them yourself. They say > they are following some ansi standard by treating date calculations like > this. > > > ---------- > > From: nayan jain[SMTP:nayan.jain@tatainfotech.com] > > Sent: Wednesday, November 24, 1999 10:43 AM > > To: Informix-List (E-mail) > > Subject: Date conversion problems. > > > > > > Hi all, > > > > I am back to this list after a long long time. > > > > There seems to be some problems with the date increment functions in > > Informix Online 7.3 > > > > If i write a statement like this > > > > Let p_date = "29-02-2000" + 1 UNITS YEAR > > > > 29-02-2000 means 29th february 2000. > > > > It gives an error like > > > > ---------- > > FORMS statement error number -1267. > > The result of a datetime computation is out of range. > > ---------- > > > > If i write this in sql then i get an error like this > > > > ------- > > select date("29-02-2000") + 1 units year from dummy > > # ^ > > # 1267: The result of a datetime computation is out of range. > > # > > ------- > > > > Have anyone of u encountered the similar error. > > > > Also what is the reason and solution to this. > > > > Thanks in Advance > > > > With Regards > > > > Nayan Jain ! > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > "By working faithfully eight hours a day, you may eventually > > get to be a boss and work twelve hours a day." > > -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN #include <disclaimer.h>