Home > Expression Operators > Date Operators > #MONTHDIF

#MONTHDIF

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

Syntax:

enddate #MONTHDIF startdate

All modes other than German mode

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_-2043070890.gif

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

The decimal months are then subtracted.

Example:

image/ebx_-2028267036.gif

 German Mode

Examples:

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

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

Details of calculation:

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

4/14/1978 4/13/1993  15 years
4/14/1993 9/13/1993    5 months
9/14/1993 9/30/1993  17 days
10/1/1993 10/1/1993    1 day

 

Related Operators:

#YEARDIF