Age Calculation

  • Follow


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?  

0
Reply tomr40 (1) 4/29/2004 2:15:56 AM

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?  
> 
0
Reply Michael 4/29/2004 3:13:15 AM


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@shaw.ca
http://www.members.shaw.ca/ajlawrance/





"Tom Ryan" <tomr40@surfbest.net> wrote in message
news:BCB5CF8C.13AEE%tomr40@surfbest.net...
> 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?
>


0
Reply AL 4/29/2004 3:32:16 AM

in article fp_jc.2014$wY.1358@nwrdny03.gnilink.net, Michael M at
mmyett@hotmail.com wrote on 4/28/04 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:
>> 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

0
Reply Tom 4/29/2004 12:26:21 PM

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

> 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

0
Reply Lee 4/29/2004 12:49:31 PM

In article <BCB5CF8C.13AEE%tomr40@surfbest.net>,
 Tom Ryan <tomr40@surfbest.net> 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

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
0
Reply JR 4/29/2004 3:20:07 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@shaw.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.

0
Reply jack 6/21/2005 9:11:09 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:

>
> 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@shaw.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.
0
Reply Matt 6/21/2005 9:23:02 PM

7 Replies
232 Views

(page loaded in 0.5 seconds)

Similiar Articles:













7/17/2012 12:01:39 PM


Reply: