Date Functions: Months_Between

Description: Returns the months in between (separating) two given dates.

MONTHS_BETWEEN(<latest_date>, <earliest_date>)
 
SELECT MONTHS_BETWEEN(SYSDATE+365, SYSDATE-365) FROM dual;
 
SELECT MONTHS_BETWEEN(SYSDATE-365, SYSDATE+365) FROM dual;

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.