Calculating Age in Cognito Forms.
Age in years:
= DateTime.Today.Year - BirthDate.Year + (
if DateTime.Today.Month < BirthDate.Month or
(DateTime.Today.Month = BirthDate.Month and
DateTime.Today.Day < BirthDate.Day) then -1 else 0)
This way we can calculate the age today, what about if I need to calculate the age, in years, at January the 1st 2019?
Best Answer
The easiest way for you to this is to simply replace
with
This calculation would also work, and is less complicated.