dbTalk Databases Forums  

Age Calculation

comp.databases.filemaker comp.databases.filemaker


Discuss Age Calculation in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Ryan
 
Posts: n/a

Default Age Calculation - 04-28-2004 , 09:15 PM






I have a FMP database that keeps track of driver education students. I'm
not knowledgeable in FMP, but I can usually get it to do what I want.
Which one of these formulas would work best to calculate age based on birth
date and the system date or is there a better one? I'm using the second one

Year(Today) - Year(Birthdate) - If(Today< Date(Month(Birthdate),
Day(Birthdate),Year(Today)),1,0)

Year(Status(CurrentDate)) - Year(Birthdate) - If(Status(CurrentDate)<
Date(Month(Birthdate), Day(Birthdate),Year(Status(CurrentDate))),1,0)

I'm also having trouble with the age not recalculating every day. I'm using
FMP 4.1 and in the storage options I have the box checked for "do not store
calculation results" It should still recalculate every day shouldn't it?


Reply With Quote
  #2  
Old   
Michael M
 
Posts: n/a

Default Re: Age Calculation - 04-28-2004 , 10:13 PM






Your using the best of the two, infact, the Today function has been
removed from the most current version of FileMaker and has only hung
around so long for backwards compatability.

Although age calculations tend to be a bit tricky, I don't see any
reason yours isn't working properly. So I'm a little confused when you
say doesn't recalculate everyday.

Are there ages that are not updating correctly or were you used to the
Today function, which recalculated all the records everytime the
database was opened?

Michael Myett

Tom Ryan wrote:
Quote:
I have a FMP database that keeps track of driver education students. I'm
not knowledgeable in FMP, but I can usually get it to do what I want.
Which one of these formulas would work best to calculate age based on birth
date and the system date or is there a better one? I'm using the second one

Year(Today) - Year(Birthdate) - If(Today< Date(Month(Birthdate),
Day(Birthdate),Year(Today)),1,0)

Year(Status(CurrentDate)) - Year(Birthdate) - If(Status(CurrentDate)
Date(Month(Birthdate), Day(Birthdate),Year(Status(CurrentDate))),1,0)

I'm also having trouble with the age not recalculating every day. I'm using
FMP 4.1 and in the storage options I have the box checked for "do not store
calculation results" It should still recalculate every day shouldn't it?


Reply With Quote
  #3  
Old   
AL Lawrance
 
Posts: n/a

Default Re: Age Calculation - 04-28-2004 , 10:32 PM



The better calculation is the second one as previously mentioned ... works
with FM 7.

The only problem in calculating I can think of is when the date of birth
has been formatted (e.g., April 4, 1988) ... it has given me problems in the
past. Make sure the date of birthday is entered mm/dd/yyyy with NO
FORMATTING.

If you set the system clock ahead or back you can see the age change.
Obviously, the only time an age changes is when the birthdate of a student
crosses over the system date; otherwise, no change in a student's age will
occur.


--
Al Lawrance
ajlawrance (AT) shaw (DOT) ca
http://www.members.shaw.ca/ajlawrance/





"Tom Ryan" <tomr40 (AT) surfbest (DOT) net> wrote

Quote:
I have a FMP database that keeps track of driver education students. I'm
not knowledgeable in FMP, but I can usually get it to do what I want.
Which one of these formulas would work best to calculate age based on
birth
date and the system date or is there a better one? I'm using the second
one

Year(Today) - Year(Birthdate) - If(Today< Date(Month(Birthdate),
Day(Birthdate),Year(Today)),1,0)

Year(Status(CurrentDate)) - Year(Birthdate) - If(Status(CurrentDate)
Date(Month(Birthdate), Day(Birthdate),Year(Status(CurrentDate))),1,0)

I'm also having trouble with the age not recalculating every day. I'm
using
FMP 4.1 and in the storage options I have the box checked for "do not
store
calculation results" It should still recalculate every day shouldn't it?




Reply With Quote
  #4  
Old   
Tom Ryan
 
Posts: n/a

Default Re: Age Calculation - 04-29-2004 , 07:26 AM



in article fp_jc.2014$wY.1358 (AT) nwrdny03 (DOT) gnilink.net, Michael M at
mmyett (AT) hotmail (DOT) com wrote on 4/28/04 10:13 PM:

Quote:
Your using the best of the two, infact, the Today function has been
removed from the most current version of FileMaker and has only hung
around so long for backwards compatability.

Although age calculations tend to be a bit tricky, I don't see any
reason yours isn't working properly. So I'm a little confused when you
say doesn't recalculate everyday.

Are there ages that are not updating correctly or were you used to the
Today function, which recalculated all the records everytime the
database was opened?

Michael Myett

Tom Ryan wrote:
I have a FMP database that keeps track of driver education students. I'm
not knowledgeable in FMP, but I can usually get it to do what I want.
Which one of these formulas would work best to calculate age based on birth
date and the system date or is there a better one? I'm using the second one

Year(Today) - Year(Birthdate) - If(Today< Date(Month(Birthdate),
Day(Birthdate),Year(Today)),1,0)

Year(Status(CurrentDate)) - Year(Birthdate) - If(Status(CurrentDate)
Date(Month(Birthdate), Day(Birthdate),Year(Status(CurrentDate))),1,0)

I'm also having trouble with the age not recalculating every day. I'm using
FMP 4.1 and in the storage options I have the box checked for "do not store
calculation results" It should still recalculate every day shouldn't it?

When I say it does not recalculate every day I mean that as a students
birthday comes and goes I find that his/her age has not updated in the
database



Reply With Quote
  #5  
Old   
Lee Smith
 
Posts: n/a

Default Re: Age Calculation - 04-29-2004 , 07:49 AM



in article BCB65E9D.13B05%tomr40 (AT) surfbest (DOT) net, Tom Ryan at
tomr40 (AT) surfbest (DOT) net wrote on 4/29/04 5:26 AM:

Quote:
Today
I've not tested your calculation for any possible problems, but I would
suggest to changes.

1. Stop using the Today function and start using the Status(CurrentDate)
function instead.

2. Unstore the Calculation will make it update daily.

HTH

Lee



Reply With Quote
  #6  
Old   
JR
 
Posts: n/a

Default Re: Age Calculation - 04-29-2004 , 10:20 AM



In article <BCB5CF8C.13AEE%tomr40 (AT) surfbest (DOT) net>,
Tom Ryan <tomr40 (AT) surfbest (DOT) net> wrote:

Quote:
I have a FMP database that keeps track of driver education students. I'm
not knowledgeable in FMP, but I can usually get it to do what I want.
Which one of these formulas would work best to calculate age based on birth
date and the system date or is there a better one? I'm using the second one
Times and dates are nothing more than integers in most (modern) computer
applications. Times in FM are simply an integer that increments 1 for
each second. Dates increment by 1 for each day. If you think about them
with these behaviors in mind many of your time and date calculations
will become MUCH easier (and faster).

JR


Reply With Quote
  #7  
Old   
jack-i
 
Posts: n/a

Default Re: Age Calculation - 06-21-2005 , 04:11 PM




I'm using FM7 and the second calculation keeps giving me an error - it
highlights STATUS and tells me this "This function cannot be found"!

Can anyone help me out, please?

Thanks,

O.

On Thu, 29 Apr 2004 03:32:16 GMT, "AL Lawrance" <ajlawrance (AT) shaw (DOT) ca>
wrote:

Quote:
The better calculation is the second one as previously mentioned ... works
with FM 7.

The only problem in calculating I can think of is when the date of birth
has been formatted (e.g., April 4, 1988) ... it has given me problems in the
past. Make sure the date of birthday is entered mm/dd/yyyy with NO
FORMATTING.

If you set the system clock ahead or back you can see the age change.
Obviously, the only time an age changes is when the birthdate of a student
crosses over the system date; otherwise, no change in a student's age will
occur.


Reply With Quote
  #8  
Old   
Matt Wills
 
Posts: n/a

Default Re: Age Calculation - 06-21-2005 , 04:23 PM



I don't have the calculation to refer to, but the big thing is that you
were given an FM6 calculation for use in FM7.

What were STATUS functions are now GET functions.

In many such situations, it is a simple matter of changing STATUS to GET,
but look in the GET FUNCTIONS Help to make sure.

Matt

On 6/21/2005, jack-i wrote:

Quote:
I'm using FM7 and the second calculation keeps giving me an error - it
highlights STATUS and tells me this "This function cannot be found"!

Can anyone help me out, please?

Thanks,

O.

On Thu, 29 Apr 2004 03:32:16 GMT, "AL Lawrance" <ajlawrance (AT) shaw (DOT) ca
wrote:

The better calculation is the second one as previously mentioned ...
works
with FM 7.

The only problem in calculating I can think of is when the date of
birth
has been formatted (e.g., April 4, 1988) ... it has given me problems
in the
past. Make sure the date of birthday is entered mm/dd/yyyy with NO
FORMATTING.

If you set the system clock ahead or back you can see the age change.
Obviously, the only time an age changes is when the birthdate of a
student
crosses over the system date; otherwise, no change in a student's age
will
occur.

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.