Formula
MONTHS_BETWEEN( date1, date2 )Parameter
Date1
The first date used to calculate the number of months between.
Date2
The first date used to calculate the number of months between.
Example 1
select months_between(to_date('201608','yyyymm'),to_date('201607','yyyymm')) from dual;
// output 1
Example 2
select months_between(to_date('201608','yyyymm'),to_date('201606','yyyymm')) from dual;
// output 2
This comment has been removed by the author.
ReplyDeleteThanks for your post. It helps me to solve my problems.
ReplyDelete