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

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?

FileMaker Pro

Last Comment
Will Loving

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 Loving

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:

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

Willmcn

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.

Again,
Thank you very much for your help

Willlmcn

Thanks
Screen-shot-2011-05-15-at-12.40..jpg
Will Loving

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?
Screen-shot-2011-05-15-at-11.43..jpg
Will Loving

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.
Will Loving

THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.

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

Really,

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.

FYI
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.

Again,
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.

Again

THANKS!
FileMaker Pro

FileMaker Pro is a cross-platform relational database application that integrates a database engine with a graphical user interface (GUI) and security features, allowing users to modify the database by dragging new elements into layouts, screens, or forms. FileMaker evolved from a DOS application, but since 1992 has been available for Microsoft Windows and Mac OS, and can be used in a cross-platform environment.

4K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts

TRUSTED BY