This formula converts the numbers to text so that the decimal places can be trimmed of without being rounded up. It works perfectly for people up to 99 years 11 months of age (could be modified to go higher)
numbervar var_totalmonths := DateDiff "m",{table.Date of Birth},{table.Target Date});
stringvar var_remainingmonths := Totext(var_totalmonths mod 12);
stringvar var_years := ToText(var_totalmonths/12);
stringvar var_yearstrimmed := If Length (var_years) = 5 Then (Left(var_years,2)) Else (Left(var_years,1));
stringvar var_remainingmonthstrimmed := If Length (var_remainingmonths) = 5 Then (Left(var_remainingmonths,2)) Else (Left(var_remainingmonths,1));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.