Equinox Online Help - Language Reference - A to Z

Home

Years

Applies to
SyntaxYears (StartExpression, EndExpression)
Action[Function] Returns the number of whole years between two dates.
ScopeUsable anywhere
Notes

This function returns the number of whole years between the dates supplied in StartExpression and EndExpression.

CategoryDate handling
See Also Year, Day, Dayname, Dayofweek, Dayofyear, Dmy, Dmyadd, Leapyear, Month, MonthName, Months, ServerDateTime, Today, Week, WeekOfYear, WeekStart
Example

This example calculates the age of a patient.

age = Years(BirthDate, Today)