Home > Blogroll, sql > Paul Moen article on MONTHS_BETWEEN

Paul Moen article on MONTHS_BETWEEN

January 5th, 2007

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

Blogroll, sql

  1. January 6th, 2007 at 02:49 | #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

  2. January 6th, 2007 at 08:41 | #2

    Thanks for the clarification. I edited the title of this post (but not the URL to avoid broken link).

    I hope this is acceptable

  1. No trackbacks yet.