Re: Date calculation gives strange format
Posted in 1997
In <3.0.1.32.19970423155614.006944e4@marvin>, Richard Thomas wrote: <snip> >> select date(date('1/4/1997') + 1 units month) from uniq; <snip> >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! > <snip> Richard, Use of units has its limitations with date field. In you example for that featue to work properly you should be incrementing year and/or month using datetime year to month field, other wise it could go wrong in situations like in second example below. 1) select date(date('03/30/1997') + 1 units month) from b_sys; 2) select date(date('03/31/1997') + 1 units month) from b_sys; You could use extend function for conversion from date to datetime. I thnik I have posted a similar mail months back. Addition of units month, simply increments the month, without caring for the result of the expression and adjusting the date accordingly. -- Have a nice day Felix K. Mathews fmathews@systems.dhl.com