AnsweredAssumed Answered

Age related problem

Question asked by PeterJohnson on Feb 10, 2015
Latest reply on Feb 11, 2015 by Suresh

Title

Age related problem

Post

FMP Advanced 13

FMP 13 Server

Using a calculation field kindly donated by someone to calculate the age of a child based on date of birth and a "Today" field.

Date of Birth and Today are in the format dd/mm/yyyy (for Australian audiences)

The calculation steps seem to want them in mm/dd/yyyy which is obviously giving me weird answers.  I will paste the calculation below if anyone could help me that would be greatly appreciated.

 

GetAsText(Year(Today) - Year(Date of Birth) - Case(GetAsNumber(Today)< Date(Month(Date of Birth);Day(Date of Birth); Year(Today)); 1; 0)) & " Years, " & GetAsText(Mod(Month(Today) - Month(Date of Birth) + 12 - Case(Day(Today) < Day(Date of Birth); 1; 0); 12)) & " Months, " & GetAsText(Day(Today) - Day(Date of Birth) + Case(Day(Today) >= Day(Date of Birth); 0; Day(Today- Day(Today)) < Day(Date of Birth); Day(Date of Birth); Day(Today- Day(Today)))) & " Days"

Outcomes