Re: Number of months...
Posted in 1997
On 31 Mar 97 at 11:11, Michael Hoffman wrote: } } Ok, this may be the simplest question I've ever posted, but, then agin, it may } be as tough as we've found. } } What we have are 2 dates and 2 datetimes. We need to find the number of months } between each of the dates and each of the datetimes. Since there is no defined } "MONTH" function, we have had to come up with our own. They seem extremely } cludgy and inefficient. } } I am hoping the gurus out there will have come across this in the past and can } shed some light. } } I would post our code, but it's almost embarrassing! :-} We went so far as } to parse the date string. As I said, it is ugly code. } } Thanks fort the help! } } Michael Hoffman } } This had come out in the Informix Mail sometime back, so I am just reposting the example. ((year(date (8/27/90))-year(date (8/27/80 )))*12) + (month(date (8/27/90))-month(date (8/27/80 ))) Try it out. It definitely works. Of course, the dates provided are examples. Gopi.