belph Posted May 24, 2004 Posted May 24, 2004 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
Damocles Posted May 24, 2004 Posted May 24, 2004 Welcome to the Forums! 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
Cousin Jack Posted May 24, 2004 Posted May 24, 2004 Sorry, I obviously didn't mean "script", but rather the calculation for your "age" field.
Vaughan Posted May 24, 2004 Posted May 24, 2004 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.
-Queue- Posted May 24, 2004 Posted May 24, 2004 Year ( Get ( CurrentDate ) ) - Year ( DOB ) - ( Get ( CurrentDate ) < Date ( Month ( DOB ) ; Day ( DOB ); Year ( Get ( CurrentDate ) ) ) )
Cousin Jack Posted May 25, 2004 Posted May 25, 2004 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
Cousin Jack Posted May 25, 2004 Posted May 25, 2004 Thanks vaughan, I didn't realise that. The script works OK in normal use, I presume that you just replace "Today" with "Status(Current date)" Regards Jon.
belph Posted May 25, 2004 Author Posted May 25, 2004 Hello all, Thanks a lot to all of you, I wasn't expecting so many replies so soon This is a really friendly and helpful forum, thanks for having made me feel at home. Rob
PRP407 Posted July 30, 2004 Posted July 30, 2004 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. This forum is a GREAT resource
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now