Forum Discussion

MeaganMcOlin's avatar
MeaganMcOlin
Qrew Trainee
3 years ago

How many years from date

Hello,

I am looking for a code that will tell me how many years have passed from a certain date. 

For example, we have a field for an employee's Start Date. I would like another field to calculate how many years they have been working here based on today's date. 

Any help would be appreciated! 

Thanks,  

Meagan



------------------------------
Meagan McOlin
------------------------------

1 Reply

  • try this as a numeric formula field

    var date HireDate = [my hire date field];

    Year(Today())-Year($HireDate)
    -
    If(
    Month(Today())<Month($HireDate)
    or
    (Month(Today())=Month($HireDate) and Day(Today())<Day($HireDate)),1,0)

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------