At 21:03, 19991007, John Hennessy wrote:
>> Examples demonstrate this easily:
>> DATE_ADD('1999-01-31', INTERVAL 1 MONTH) ==> 1999-02-28
>> DATE_ADD('1999-01-31', INTERVAL 3 MONTH) ==> 1999-04-30
>> DATE_ADD('1999-01-31', INTERVAL 6 MONTH) ==> 1999-07-31
>> DATE_ADD('1999-01-31', INTERVAL 12 MONTH) ==> 2000-01-31
>
>What I am trying to achieve is same day calendar month billing where
>possible and last day of the month where it is not.
I don't see how the behavior of DATE_ADD(..., INTERVAL 1 MONTH) differs
from what you want. If you start with 1999-01-14 and you add a month,
you'll get 1999-02-14. If you start with 1999-01-29 and you add a
month, you'll get 1999-02-28. Isn't that exactly what you desire? If
you can show an example of where DATE_ADD doesn't do what you want, it
would help clear things up a lot!
Tim