Re: (Q) Subtract 6 months from a date: result=error -1267!!!
Posted in 1994
->From: ckipp@vth1.vth.colostate.edu (Cathy Kipp) ->Subject: Re: (Q) Subtract 6 months from a date: result=error -1267!!! ->To: dberg@informix.com ->Date: Thu, 14 Apr 1994 07:31:00 +22304916 (MDT) ->Cc: informix-list@rmy.emory.edu -> ... omitted ... -> ->But how about solving the problem through use of an environment variable, ->say DB_MONTH_MATH. The default could then be the ANSI standard, or: -> ->DB_MONTH_MATH=ANSI - would behave as ANSI standard ->DB_MONTH_MATH=LAST - would assume that if the original day of month or -> the result day of month falls on the last day of the -> month (or greater), the result is the last day of -> the month ->DB_MONTH_MATH=n - where n indicates the number of days which should -> be assumed to be in a month. If n = 30, and 3 months -> are subtracted, then 90 days would be subtracted. If -> it wasn't too horrendous, n could be a decimal number, -> then you could set it to say 30.5 and round the -> result. -> ->You're right that mathematical properties should be maintained as should ->compliance with the ANSI standard, but it would be nice if there were an ->alternate solution. -> ->It just seems that there are always new people coming up against this ->problem, and while many people wish to remain ANSI compliant, there is always ->going to be a contingent of people who just want to get work done. -> ->Regards, -> ->- Cathy I like this approach a LOT!! Especially the ANSI and LAST options. I see some technical issues regarding "n", but it is still a creative solution. The addition of still another environment variable modifying the database's behavior will require a bit of work from Informix, but it gives the most flexibility. Users could then choose the behavior they want their systems to exhibit. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, SLS | / \\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\