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 :evil:

update: but it is documented

2 thoughts on “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.

    Cheers
    Paul

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>