![]() Previous |
![]() Next |
MONTHS_BETWEEN calculates the number of months between two dates. When the two dates have the same day component or are both the last day of the month, then the return value is a whole number. Otherwise, the return value includes a fraction that considers the difference in the days based on a 31-day month.
Return Value
NUMBER
Syntax
MONTHS_BETWEEN(date1, date2)
Arguments
date1 and date2 are datetime expressions. If date1 is later than date2, then the result is positive. If date1 is earlier than date2, then the result is negative.
Example
MONTHS_BETWEEN('15-APR-06', '01-JAN-06') returns the value 3.4516129.