truncate(DateDiff("d",{?prmBirthdate},{?Effective Date})/365,0)
However we recently discoverd that there is a rounding error and if the report is run the day before a person's birthday after about age 3 it starts to be off by .0027 and then finally by one full day (an then there is Feb 29th in leap years).
So here are two formulas that we found that work without that error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
datediff('yyyy',{?prmBirthdate},{?Effective Date}) - (if datepart('y',{?Effective Date})>=datepart('y',{?prmBirthdate}) then 0 else 1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NumberVar CurrentYrBirthdateVar := IIF(100 * month({?Effective Date}) + day({?Effective Date}) < 100 *
month({?prmBirthdate}) + day({?prmBirthdate}),1,0);
NumberVar AgeAsofEffectiveDate := DATEDIFF("yyyy",
{?prmBirthdate},{?Effective Date}) - CurrentYrBirthdateVar;
AgeAsofEffectiveDate;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hope that helps someone some where
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~