Skip to main content
Question

Formula to show duration between 2 dates in order to calculate how long employee has been employed

  • July 19, 2017
  • 0 replies
  • 58 views

I would like to show the amount of time an employee has been employed.  We have the following date fields;

[Date of Hire]

[Termination Date]

as well as a checkbox field ([Active]) for if they are active.

If they have been terminated, it should be termination date-date of hire, but if they are still active, we would like it to be today()-date of hire.

I do not know if the formula field should be Numeric or Duration, but we prefer the end number to be in years (1.5, 3.1, 0.8, etc.).


This topic has been closed for replies.

Not tested but try this as a formula Numeric field called [Service Years]


var date EndDate = IF(IsNull([Termination Date],Today(),[Termination Date]);

ToDays($EndDate - [Date of Hire]) / 365.25