3 Replies Latest reply on Aug 7, 2009 3:35 PM by comment_1

    Calculating age using date collected and DOB (Date of Birth)

    HappyHour

      Title

      Calculating age using date collected and DOB (Date of Birth)

      Post

      I found this calculation from FM;

      GetAsText ( Year ( Get ( CurrentDate ) )  - Year ( Birthdate ) - If ( Get ( CurrentDate ) <  Date ( Month ( Birthdate ) ; Day ( Birthdate ) ; Year ( Get ( CurrentDate ) ) ) ; 1 ; 0 ) ) & " Years, " & GetAsText ( Mod ( Month ( Get ( CurrentDate ) ) - Month ( Birthdate ) + 12 - If ( Day ( Get ( CurrentDate ) ) < Day ( Birthdate ) ; 1 ; 0 ) ; 12 ) ) & " Months, "  and it works fine when I substitute my d'bases fields "Date Collected" for "Get (CurrentDate" and "DOB" for "Birthdate" ....but I really don't want to show "0" years when a person is <1 yr. I would like to show only months. The other option would be to show"<1" instead of months.

      I've fiddled with the calc and come up to a road block.

      Greg