Paul Moen article on MONTHS_BETWEEN

I have been shocked by Paul Moen article on MONTHS_BETWEEN.

Here is my own case :

SQL> select months_between( date '2000-03-01', date '2000-02-28') * 31 from dual;

Incredible! I have always been very careful with months_between because of the documented end_of_month behaviour (there is one month between 30-APR and 31-MAY), but I did not know the fractional part of add_months was based on a 31-day month 👿

update: but it is documented

2 Replies to “Paul Moen article on MONTHS_BETWEEN”

  1. Salut Laurent,

    To give credit where credit is due – this one is by Paul Moen not me. 🙂

    Orablogs makes all Pythian Group blogs (over a dozen authors) look like they come from me but I plan to work with Brian Duff on that at some point to fix it.


Leave a Reply

Your email address will not be published.