AnsweredAssumed Answered

Need to generate list of Under 21 from DOB category

Question asked by MaryMurray on Jun 20, 2014
Latest reply on Jun 20, 2014 by philmodjunk

Title

Need to generate list of Under 21 from DOB category

Post

     Hi,

      

     New to File Maker Pro.

      

     I'm working to generate a list of students who are Under 21 years of age. I currently have a layout that gives me their name and DOB.  How do I ask FMP to generate a list of students under 21 based on the DOB field? I googled to find a command: 


FullAge (calculation, text result) = 
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, " & GetAsText ( Day ( Get ( CurrentDate ) ) - Day ( Birthdate )  + If ( Day ( Get ( CurrentDate ) )  ≥ Day ( Birthdate ); 0 ; If ( Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) < Day ( Birthdate ) ; Day ( Birthdate ) ; Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) ) ) ) & " Days " 

I don't exactly understand if this command will work since my category of birthdates is called DOB.  Would replacing "Birthdate" with "DOB" make this command work? 

Also- I am not sure even how to implement the code. Do I create a button? What do I do to complete this task?

      

I would appreciate all the help I can get.

Thank you

Outcomes