Oracle® OLAP Expression Syntax Reference Release 11.2 E23381-01 |
|
|
PDF · Mobi · ePub |
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.
NUMBER
MONTHS_BETWEEN(date1, date2)
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.
MONTHS_BETWEEN('15-APR-06', '01-JAN-06')
returns the value 3.4516129
.