ProAdmin Tip: Calculating Age Last Birthday in an Expression

Did you know…

During the coding process, it may be necessary to capture the age of a participant within an expression. A common example of this is determining early retirement eligibility that can’t be handled in an eligibility definition. Keep this expression handy for determining age at termination.

Lines starting with a semicolon are notes for clarity:

;calculate age last birthdate at termination (#DODEC) using database field BirthDate

;age difference in years

age:= (#YEAR #DODEC) – (#YEAR BirthDate) &

 

;if termination is on or after date of birth, then include the year

mmdd_dec:= (#DAY #DODEC) + (100*#MONTH #DODEC) &

mmdd_dob:= (#DAY BirthDate) + (100*#MONTH BirthDate) &

d:= (mmdd_dec < mmdd_dob) &

 

;if date of birth is a leap day and termination is not a leap day,

;then we only need to get to 2/28 to include the year

leapadj:= (mmdd_dec=0228) #AND (mmdd_dob=0229) #AND #NOT #IFLEAPYR #YEAR #DODEC &

 

age – (d #AND #NOT leapadj)

We encourage you to visit the FAQ section of the Help to review other insights and examples for handling dates and age math in ProAdmin expressions.

Additional Resources
More information on this can be found in ProAdmin Help using the following links:
Administration Tools
Benefit Component Tables