dbTalk Databases Forums  

Calculating Age using FileMaker Pro 7 or 8

comp.databases.filemaker comp.databases.filemaker


Discuss Calculating Age using FileMaker Pro 7 or 8 in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gpicache@gmail.com
 
Posts: n/a

Default Calculating Age using FileMaker Pro 7 or 8 - 05-31-2007 , 05:54 PM






I would like to ask for help with calculating for a person's age with
the new versions of filemaker.

With the new database I am trying to develop, I need to calculate the
age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case of
currentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!


Reply With Quote
  #2  
Old   
Jens Teich
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 05-31-2007 , 06:21 PM






gpicache (AT) gmail (DOT) com writes:

Quote:
I would like to ask for help with calculating for a person's age with
the new versions of filemaker.

With the new database I am trying to develop, I need to calculate the
age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case of
currentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!
Let([
now = Get( CurrentDate ) ;
presentyear = Year( now ) ;
birthyear = Year( birthdate ) ;
birthday_thisyear = Date( Month( birthdate ) ; Day( birthdate ) ; Year(now) )
];

presentyear - birthyear -

// reduce result by 1 if birthday didn't take place this year
If( now < birthday_thisyear ; 1 )
)

-jens
--
http://jensteich.de
filemaker certified developer
filemaker authorized trainer


Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 06-01-2007 , 01:27 AM



In article <1180652093.532303.124870 (AT) d30g2000prg (DOT) googlegroups.com>,
gpicache (AT) gmail (DOT) com wrote:

Quote:
I would like to ask for help with calculating for a person's age with
the new versions of filemaker.

With the new database I am trying to develop, I need to calculate the
age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case of
currentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!
Don't use Today. Today is really an auto-enter field that is only
calculated when FileMaker opens. This means a system left running past
midnight will return the wrong date.

Status(CurrentDate) is the better function that returns the current
date read from the computer when it is accessed ... BUT it is a
function for older versions of FileMaker. In new versions I believe it
has been renamed to Get(CurrentDate).


As for calculating someone's age there are two things to keep in mind.

If you're using it in a Calculation field, then this will be
recalculated every time you open the Database on a new day, which on a
slow computer or LOTS of records means it can take a little while. I
used to do this on an old Mac LC II a long time ago and it would take
20mins or so to recalculate. Today's computers are of course MUCH
faster than that.

The other thing to keep in mind is that you can't simply subtract the
birth year from the year returned by Get(CurrentDate) since the person
may not have had their birthday yet this year. This leads to a
Calculation something like:

Age Calculation, Number Result, Unstored
= Year(Get(CurrentDate)) - Year(Birthdate)
- If (Get(CurrentDate) < Date(Month(BirthDate),
Day(BirthDate), Year(GetCurrentDate)), 1, 0)




Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Bill
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 06-01-2007 , 07:27 AM



In article <010620071827453300%helpful_harry (AT) nom (DOT) de.plume.com>,
Helpful Harry <helpful_harry (AT) nom (DOT) de.plume.com> wrote:

Quote:
In article <1180652093.532303.124870 (AT) d30g2000prg (DOT) googlegroups.com>,
gpicache (AT) gmail (DOT) com wrote:

I would like to ask for help with calculating for a person's age with
the new versions of filemaker.

With the new database I am trying to develop, I need to calculate the
age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case of
currentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!

Don't use Today. Today is really an auto-enter field that is only
calculated when FileMaker opens. This means a system left running past
midnight will return the wrong date.

Status(CurrentDate) is the better function that returns the current
date read from the computer when it is accessed ... BUT it is a
function for older versions of FileMaker. In new versions I believe it
has been renamed to Get(CurrentDate).


As for calculating someone's age there are two things to keep in mind.

If you're using it in a Calculation field, then this will be
recalculated every time you open the Database on a new day, which on a
slow computer or LOTS of records means it can take a little while. I
used to do this on an old Mac LC II a long time ago and it would take
20mins or so to recalculate. Today's computers are of course MUCH
faster than that.

The other thing to keep in mind is that you can't simply subtract the
birth year from the year returned by Get(CurrentDate) since the person
may not have had their birthday yet this year. This leads to a
Calculation something like:

Age Calculation, Number Result, Unstored
= Year(Get(CurrentDate)) - Year(Birthdate)
- If (Get(CurrentDate) < Date(Month(BirthDate),
Day(BirthDate), Year(GetCurrentDate)), 1, 0)




Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
I use a simple calculation that is pretty accurate:

Age = Int((Get(CurrentDate) - Birthdate)/365.25)

This returns the age in whole-number years in the conventional manner,
and takes leap-years into account. Over a long enough period it might
produce a wrong answer, because the solar year is not exactly 365.25
days, but it will give an accurate answer over the normal span of a
human lifetime.

--
For email, change <fake> to <earthlink>
Bill Collins


Reply With Quote
  #5  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 06-01-2007 , 10:43 AM



In article
<1180652093.532303.124870 (AT) d30g2000prg (DOT) googlegroups.com>gpicache (AT) gmail (DOT) c
om wrote:

Quote:
I would like to ask for help with calculating for a person's age
withthe new versions of filemaker.

With the new database I am trying to develop, I need to calculate
the age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case
ofcurrentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!

For one thing, the Today function does not exist in FM 7+, nor is
Status used any longer. The modern equivalent in 7+ is Get (
CurrentDate ).
There are several Custom Functions for calculating age at Brian
Dunning.com (age between two dates, age as of today, etc.), any of
which can be used in a calculation field rather than as a CF.
Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



Reply With Quote
  #6  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 06-01-2007 , 10:53 AM



In article <nemoFri060107113330 (AT) alphaone (DOT) com> Matt WIlls <Im (AT) Witz (DOT) End>
wrote:

Quote:
In article

1180652093.532303.124870 (AT) d30g20...oglegroups.com>gpicache (AT) gmail (DOT)
com wrote:

I would like to ask for help with calculating for a person's age
withthe new versions of filemaker.

With the new database I am trying to develop, I need to calculate
the age of a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case
ofcurrentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!

For one thing, the Today function does not exist in FM 7+, nor is
Status used any longer. The modern equivalent in 7+ is Get
(CurrentDate ).
There are several Custom Functions for calculating age at Brian
Dunning.com (age between two dates, age as of today, etc.), any
ofwhich can be used in a calculation field rather than as a CF.
Matt

Sorry....
http://www.BrianDunning.com

Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



Reply With Quote
  #7  
Old   
gpicache@gmail.com
 
Posts: n/a

Default Re: Calculating Age using FileMaker Pro 7 or 8 - 06-01-2007 , 10:58 AM



On Jun 1, 8:43 am, Matt WIlls <I... (AT) Witz (DOT) End> wrote:
Quote:
In article
1180652093.532303.124... (AT) d30g2000prg (DOT) googlegroups.com>gpica... (AT) gmail (DOT) c

om wrote:
I would like to ask for help with calculating for a person'sage
withthe new versions of filemaker.

With the new database I am trying to develop, I need to calculate
theageof a person from date of birth. Looking through the older
threads, I found the functions TODAY, and Status(CurrentDate) being
recommended. However, when I try to use either of these in a
calculation, it aways says "unable to find function" or in the case
ofcurrentdate, "unable to find specified field".

Is there a current simple calculation for it that will work?

Thanks!

For one thing, the Today function does not exist in FM 7+, nor is
Status used any longer. The modern equivalent in 7+ is Get (
CurrentDate ).
There are several Custom Functions for calculatingageat Brian
Dunning.com (agebetween two dates,ageas of today, etc.), any of
which can be used in a calculation field rather than as a CF.
Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it athttp://www.malcom-mac.com/nemo




Thank you so much, everyone. I am now excited to use your expert
advice.
It's the fist time I posted a question, and am so happy to receive
such valuable information.

gpicache



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.