From D.O.B I want to cal person age

noad used Ask the Experts™
I'm using FileMaker Pro 11,
I have a filed called D.O.B. and one call age
when I type in the persons D.O.B. I like for the age to come out on the age filed.

Can someone explain in details exactly how I can do this, please?

Thank you for your help
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Will LovingPresident, Dedication Technologies, Inc.

Age is a very straightforward calculation field. You can choose to the nearest whole year, or as I sometimes do, to show one decimal place, which is useful to see at a glance how close someone is to their next birthday. The basic calculation is:

Round( ( Get ( CurrentDate ) -  GetAsDate( DOB ) ) / 365.25 ; 0 )
Will LovingPresident, Dedication Technologies, Inc.

If you want to round the age to one decimal, you simply change the number to 1.

Round((Get ( CurrentDate ) -  GetAsDate ( DOB ))/365.25 ; 1 ) ;

Finally, if you wanted to have it show a decimal, but only for children under 10 - something I have a need for  - the calculation would look like this:

( Get( CurrentDate ) -  GetAsDate( DOB ) ) / 365.25 < 10 ;
Round( ( Get ( CurrentDate ) -  GetAsDate ( DOB ) ) / 365.25 ; 1 ) ;
Round( ( Get ( CurrentDate ) -  GetAsDate ( DOB ) ) / 365.25 ; 0 )



how do I enter the cal

If I understand correct, I'm just using this call "Round((Get ( CurrentDate ) -  GetAsDate ( DOB ))/365.25 ; 1 ) ; "  But where exactly do you put it.... so I use the filed name DOB or age?
Once in database mode if I use DOB  do I click on Options? then cal value and the click on age and in the filed paste the cal code???

Sorry my first time, I work Fire Rescue and on duty today, Been busy which is why I did not answer your post sooner.

Thank you very much for your help
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.



Maybe this will help you understand what I'm doing wrong...

Will LovingPresident, Dedication Technologies, Inc.

You've almost got it you've just got things reversed a little. You have a field called D.O.B., which is presumably a Date field (I would get rid of the periods but that's not a critical issue). You are going to create a new field called "Age" with a field type of Calculation. When you create a calculation field, FileMaker immediately opens the Specify Calculation dialog box.

It looks like in your screen shot you are attempting to convert your D.O.B. field to a calc, which is NOT what you want. The error is coming up because you have change the Get(CurrentDate) function, one of FileMaker's many "Get" functions to something that FM doesn't recognize as a function.

So, to make this work, go back to the list of fields, type in "Age" as the field name, set the field Type to Calculation, and then click "Create". In the Specify Calculation dialog, enter the calculation I gave you and substitute in "D.O.B." for my "DOB" field (or just eliminate the periods in your D.O.B. field name).


Well that was easy....

Thank you so much, but plz don't hate me.... :(

I see a problem

ie.. my B/D is on 09.26/1966 I'm currently 44, if I input that it rounds off and the cal given is 45, which is not correct.
Can this be fixed?
If so can you tell me how?
Will LovingPresident, Dedication Technologies, Inc.

You are absolutely correct and I never caught that the rounding would be rounding up for any decimal .5 and above. So assuming you don't care about partial years, here's how you do it:

Int( ( Get ( CurrentDate ) -  GetAsDate ( DOB )) / 365.25 )

"Int" is the Integer function, which just means that it gives you the whole number part of the result of any calculation ignoring any remainder.
President, Dedication Technologies, Inc.
And here's a revised version that includes my under 10 decimal calc. I've removed the round function and am using the Truncate and Integer functions. I've used the "Let" function to calculate the age first.

AgeCalc = ( Get ( CurrentDate ) -  GetAsDate ( DOB ) ) / 365.25 ;
Case( AgeCalc < 10 ; Truncate( AgeCalc ; 1 ) ; Int( AgeCalc ) )


I'm just starting, my real background is Saving life and property in that order LOL

Apart from the Fire Rescue my main thing is Networking, setting up server ect....

I'm doing this as a project for my Dept in an effort to be a paperless as possible.

Thank you very much for your help.

Im going to post another question about how to create and have an e-mail on the form to be able to e-mail the Pt report to the hospital so that when we arrive the ER has the Pt info already.

If you have the time I really like your input.

Thank you very much!


By far this has been one of the issue that I felt completely lost in, but the simple examples made it extremely easy.



 I just posted the e-mail question...

Hope to hear from you.



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial