Jump to content

This topic is 7490 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

I'm new to this forum, as I am to FileMaker, and I need a little help, because I'm not really specialised in databases.

What I'm asking is undoubtedly very simple, but I just can't seem to find a way to do it. What I need is for a field to automatically calculate somebody's age, based on the current date (obtained in one field by the Get (CurrentDate) function) and the person's date of birth, which is entered into another field.

Can some kind soul please help me with this ?

Thanks a lot,

Rob

Posted

Welcome to the Forums! smile.gif

The age/birthday function reappears periodically on the forum, so there should be some good discussion already available. Try doing a search for "birthday" in the subject line. If I remember correctly, there was also some discussion about user preferences in displaying the result.

Happy Monday!

Paul

Posted

Use Status(CurrentDate) instead of the Today function.

The Today function only calculates when the file is opened: if the file remains open overnight the result will be incorrect, and it only recalculates when the file is closed and opened again.

Also, any calculation that uses the Status(CurrentDate) function should have its storage set to unstored.

Posted

Year ( Get ( CurrentDate ) ) - Year ( DOB ) - ( Get ( CurrentDate ) < Date ( Month ( DOB ) ; Day ( DOB ); Year ( Get ( CurrentDate ) ) ) )

Posted

Hi Rob,

... me again ! this is what happens when you're still working at gone 0100 Hrs.

Age is a calculation field returning a NUMBER result , despite the words included in it. If you don't want to know the months and/or days components just omit the parts of the calculation you don't want.

I would use the "Today" function (which is a date in its own right) to get the current date rather than Get(Current date) as you suggested, and insert or type "Today" directly into the calculation as shown in my first post.

Hope this helps .. I'm off to bed !

CJ

Posted

Hello all,

Thanks a lot to all of you, I wasn't expecting so many replies so soon smile.gif

This is a really friendly and helpful forum, thanks for having made me feel at home.

Rob

  • 2 months later...
Posted

Thanks for this calculation.

I used

Year ( Get ( CurrentDate ) ) - Year ( DOB ) - ( Get ( CurrentDate ) < Date ( Month ( DOB ) ; Day ( DOB ); Year ( Get ( CurrentDate ) ) ) )

from Queue and it worked perfectly.

smile.gif

This forum is a GREAT resource grin.gif

This topic is 7490 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.