The YEARS FROM function returns the number of years between two date values.
The YEARS FROM function is similar to, but different from, the AGE function. AGE determines the number of years between a specific date and TODAY, but YEARS FROM is used when you need to be more explicit about both the start and end dates.
Function name | YEAR FROM |
Usage model | YEARS FROM ( start:DATE, finish:DATE ) |
Parameters | This function requires you to replace two parameters: |
start: DATE |
The function determines the number of years between this date and the finishing date. |
finish: DATE |
The function determines the number of years between this date and the starting date. |
Result | A number value. |
In the following example, the YEARS FROM function finds the client’s age at the time of the hearing:
YEARS FROM( HearingDate, BirthDate )
In this next example, an expression uses YEARS FROM to determine whether or not the employee will have worked at the company for 25 years or more at the time of retirement:
YEARS FROM( HireDate, RetirementDate ) >= 25
After you download the example template, you can import the template to any workspace to see this example code in action.