Re: SE RDS v4.10: Adding units of MONTH to a DATETIME
Posted in 1995
> Hi, > > I wondered if anybody has come across this one before: > > I am using Informix SE RDS v4.10 and want to use a datetime variable > to determine a date 6 months forward of the current system date. > > I tried using something like: > > let new_date = today + 6 units month > > Unfortunately, for a date such as 31/10/1995, the above statement sets > new_date = 31/04/1995 and the program, obviously, reports an error. ^^^^^^^^^ Maybe it's not so obvious. If you had run this code one day earlier there would have been a valid date generated, (though in the *past* rather than the future!) Your code might well have run merrily on without having the intended impact but yielding no error. > Has this problem been fixed in any later releases of RDS ? > Suggestions greatly appreciated. > > Keith In v7.1 OnLine we use days, rather than months, and it works very well: define new_date datetime year to day let new_date = today +180 display new_date 1996-04-15 Unless there's some reason to use months that's the way I'd go. __________________________________________________________________ | Clem Akins Standard Disclaimers Apply | |Reynolds Metals Co, Alloys Plant "Climb High, Cave Deep!" | | Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com | |________________________________________________________________|