4 Replies Latest reply on Jun 19, 2010 7:29 PM by FMNewbie

    Age calculations

    FMNewbie

      Title

      Age calculations

      Post

       

      (FileMaker Advanced 11 on Mac OS Snow Leopard)

       

      I have read several posts about calculating age using the current date and the date of birth by subtracting one from the other which returns a value equal to the number of days which, if divided by 365 will give you the number of years.  Simple enough... but my database will have entries for adults, children and infants.  I have been trying to figure out how write a script that will use CurrentDate and DateOfBirth to enter a value in CurrentAge as either:

       

          (a)  an age in years if they are older than 2 yrs old with the text "years old" appended to it

          (b)  an age in months if they are between 1 month and 2 yrs old with the text "months old" appended to it

          (c)  an age in days if they are a newborn less than 1 month old  with the text "days old" appeneded to it

       

      Any suggestions??   I'm still getting my head around scripting and I'd appreciate any input.  Thanks!!  :)