yearsbetween(
STARTDATE
,
ENDDATE
)

The yearsbetween( function calculates the number of years between two dates.


Parameters

This function has two parameters:

startdate – the starting date (see the date( function.)

enddate – the ending date


Description

This function calculates the number of years between two dates, accounting for leap years.

yearsbetween(date("1/1/98"),date("1/1/2005")) ☞ 7
yearsbetween(date("1/2/98"),date("1/1/2005")) ☞ 6

Note: This function is equivalent to:

yearvalue(enddate) - yearvalue(startdate) - ?(monthvalue(startdate) > monthvalue(enddate) or
    monthvalue(startdate)=monthvalue(enddate) and dayvalue(startdate) > dayvalue(enddate),1,0)

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.