4 Replies Latest reply on Jul 23, 2012 3:39 PM by philmodjunk

    Calculating Age based on current date and birthdate

    CharlotteTressler

      Title

      Calculating Age based on current date and birthdate

      Post

      I have been wrestling all afternoon with creating a calculated field that would update a patient's age by referencing the current date and the patient's date of birth.  I found the following script on the FileMaker Website, and named the fields to match the field names in the script.  FileMaker accepted the script, but my "Age" field still comes up with a question mark.

      Year(Get(CurrentDate))-Year(Birthdate)-If(Get(CurrentDate)<Date(Month(Birthdate);Dat(Birthdate);Year(Get(CurrentDate)));1;0)

      I tried just formatting it as:  Age=CurrentDate-Birthdate  

      FileMaker gives me a wild number like 707465 as a result

      I was able to do the tutorial on entering calculated fields in the Missing Manual without any problems, so I'm not sure what's going wrong here.

      Any suggestions?