Re: Date calculation gives strange format
Posted in 1997
In article <5jm0c4$atc@cssun.mathcs.emory.edu>, johnl@informix.com (Jonathan Leffler) wrote: > > }Date: Wed, 23 Apr 1997 15:56:14 +0100 > }From: Richard Thomas <richardt@themusicstore.co.uk> > }Subject: Re: Date calculation gives strange format > }X-Informix-List-Id: <list.14161> > } > }>How about: > }> > }> select date(date('1/4/1997') + 1 units month) from uniq; > } > }Thanks for the super-quick answer (got the answer before the question > }got back to me from the list!!). Tried it, and it works fine! > > Sorry to spoil the show, but it won't work on 31st May, 31st August, 31st > October, 31st March, nor the 29th January (most years), 30th and 31st > January (assuming that 1 month is added). > > Dealing with those dates is much harder. > > Yours, > Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> Hi, two possible environment variables for datetime formatting: Version 7.1x - you could set DB_TIME environment variable to something like '%d/%m/%Y', but!!! this variable effects only ESQL/C programs. Version 7.2x - you could set GL_DATETIME environment variable to the same value, but!!! this variable does not effect anything - there is an open bug number 64589 in OnLine 7.22UC1X2 - the last OnLine version I have. As Jonathan said, this thing is not so easy as described. So the only possible way to get what you want is to write your function in SPL, 4GL or ESQL/C. I thing it is already somewhere in iiug archive (this problem was discussed in c.d.i. before). Regards, Miroslav Lorenc SSA Czech Republic -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet