AnsweredAssumed Answered

Age calculation as of a certain date?

Question asked by sdurante on Mar 14, 2017
Latest reply on Mar 14, 2017 by philmodjunk

I found a script that gives me age as of CURRENT DATE:

GetAsText ( Year ( Get ( CurrentDate ) )  - Year ( Date of Birth) - If ( Get ( CurrentDate ) <  Date ( Month ( Date of Birth) ; Day ( Date of Birth) ; Year ( Get ( CurrentDate ) ) ) ; 1 ; 0 ) ) & " Years, " & GetAsText ( Mod ( Month ( Get ( CurrentDate ) ) - Month ( Date of Birth) + 12 - If ( Day ( Get ( CurrentDate ) ) < Day ( Date of Birth) ; 1 ; 0 ) ; 12 ) ) & " Months, " & GetAsText ( Day ( Get ( CurrentDate ) ) - Day ( Date of Birth)  + If ( Day ( Get ( CurrentDate ) )  = Day ( Date of Birth); 0 ; If ( Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) < Day ( Date of Birth) ; Day ( Date of Birth ) ; Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) ) ) ) & " Days "

 

The result looks like this: "16 Years, 2 Months, 41 Days"

 

What I need is age as of a certain date. I found it's not as simple as changing "Get ( CurrentDate )" everywhere it appears to a date field containing the target date.

Outcomes