Make sure the calculation is unstored.
Thank you! I'll try that.
I use this as a custom function. It only takes 2 fields: dob and dod. (date of birth and date of death). If dod and dob both have dates the it calculates the difference between them. If the dob has a date and dod is empty, then it calculates the difference between dob and currentdate. Otherwise it makes the function field "".
Case(dob and dod; Year(dod) - Year(dob) -1; dob and IsEmpty(dod); Year(Get(CurrentDate))-Year(dob)-1; "")
I know I am responding to a very old post, but the function Ron posted is too simplistic and I do not want others to be frustrated. His function does not account for whether the person's birthday has already occurred this year or whether the dod was before or after their birthday. I use the following function to report how many years old a person was (no rounding) if alive or at time of death.
And be sure to make sure you have checked "Do not store results, recalculate as needed" under Storage Options.
If( Date_Birthday = "" ; "";
Case (DayOfYear (Date_Deceased) ≥ DayOfYear (Date_Birthday);
Case (DayOfYear (Date_Birthday) > DayOfYear (Get(CurrentDate));