I'm not very experienced with calculations and need a little help with a calculation that the result is a persons age when you have monthbirth / daybirth / yearbirth in seperate fields, this gives you a value in a dob_ct field. (showing total dob as 04/10/1954 instead of seperate fields). The calc then shows age as a number 58 and needs to also break down the age to month day year when the person is less than 2 years old.

I know some of you wizz's out there can handle this.......

In advance, thanks.

Greg

Hi Greg -

Here are two calculations that might help here... the second one for "AgeText" shows a field called "DOB" which you could swap for your "dob_ct" field. Variables could also be used if necessary to neaten up the second calculation - e.g. use a "Let" calculation to first set a $dob variable and $currentdate variable. I'm sure there could be a better way to do the second one also. AgeDecimal is handy as it allows for easy sorting and searching of age ranges etc.

AgeDecimal (calculation type is number) = Round ( (Get (CurrentDate ) - dob_ct ) /365.25 ; 2 )

AgeText =

GetAsText ( Year ( Get ( CurrentDate ) ) - Year ( DOB ) - If ( Get ( CurrentDate ) < Date ( Month ( DOB ) ; Day ( DOB ) ; Year ( Get ( CurrentDate ) ) ) ; 1 ; 0 ) ) & " Yrs, " &

GetAsText ( Mod ( Month ( Get ( CurrentDate ) ) - Month ( DOB ) + 12 - If ( Day ( Get ( CurrentDate ) ) < Day ( DOB ) ; 1 ; 0 ) ; 12 ) ) & " Mths, " &

GetAsText ( Day ( Get ( CurrentDate ) ) - Day ( DOB ) + If ( Day ( Get ( CurrentDate ) ) ≥ Day ( DOB ); 0 ; If ( Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) < Day ( DOB ) ; Day ( DOB ) ; Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) ) ) ) & " Days"