I’m trying to use the function FullYearsBetween to calculate the years between a person’s date of birth (reported as 3 separate fields for year, month and day using single-select question with combo box to limit choices). Since it is possible to have missing information or a day value that is not legitimate for a given month or year-month combination, the FullYearsBetween function does not always return a value.
Is there a way to test for a legitimate date, use the function when the date is good, and assign a specific value when the date is bad?
This is my current syntax (without any validation):
FullYearsBetween((new DateTime((int)P6_DOB_Year, (int)P6_DOB_Month, (int)P6_DOB_Day)),(new DateTime((int)2020, (int)05, (int)01)))