AnsweredAssumed Answered

Calculate age

Question asked by thumper on Jan 7, 2010
Latest reply on Jan 8, 2010 by thumper

Title

Calculate age

Post

I have animalsin my database with a birthday field, is there a way to calculate the total age of  the animal so the field i have called "current age" would show the following :

 

ex: 1 year, 4 months, 22 Days

 

 

im currently using the following calculation for this field:

 

If ( Month ( Get ( CurrentDate )) < Month (Reptile DOB) ; Year ( Get ( CurrentDate ) ) - Year ( Reptile DOB ) - 1 ; Year ( Get ( CurrentDate ) ) - Year ( Reptile DOB ) )

 

 

and if the animal is under a year or less the then one month old, then it should show as:

 

ex: 0 Years, 0 Months, 3 Days

 

 

i tried using the code above and changing it to show the months and days as well but it just messed it up.

Outcomes