Home > Expression Operators > Date Operators > #MONTHDIF

#MONTHDIF

Returns the number of months between two dates; the returned value may be fractional.

Syntax:

date1 #MONTHDIF date2

Examples:

10/1/1995 #MONTHDIF 7/1/1995 equals 3

10/1/1993 #MONTHDIF 4/14/1978 equals 185.5666667

Details of calculation:

Each date is first converted to a decimal month using the equation:

image\ebx_1951221009.gif

* February contains either 28 or 29 days depending on the year.

The decimal months are then subtracted.

Example:

 

 

image\ebx_363257168.gif

 

 

Related Operators:

#YEARDIF