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;
4

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 thoughts on “Paul Moen article on MONTHS_BETWEEN

  1. Paul Vallee

    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.

    Cheers
    Paul

Comments are closed.