Forum Discussion

Re: How to calculate the number of years between two dates?

You can put a floor of zero on the result.

var date HireDate = [Employee Adjusted Service Date];

var date IncidentDate = [Date Reported];

  

var number RawCalc = Year($IncidentDate) -Year($HireDate)

-

If(Month($IncidentDate) < Month($HireDate)

or


Month($IncidentDate) = Month($IncidentDate) and Day($HireDate) <Day($IncidentDate),1,0);

Max(0, $RawCalc)
No RepliesBe the first to reply