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.
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.
MONTHS_BETWEEN('15-APR-06', '01-JAN-06') returns the value