dbTalk Databases Forums  

Calculating age on a specific date

comp.databases.filemaker comp.databases.filemaker


Discuss Calculating age on a specific date in the comp.databases.filemaker forum.



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

Default Calculating age on a specific date - 01-04-2011 , 10:37 PM






In my database for a 10K Run I need to calculate the age a runner will
be on 3/19/2011 (using their DOB)

Been using:
Case(Date(Month(DOB);Day(DOB);Year(Modification))> Modification;Year(Modification)-
Year(DOB)-1;Year(Modification)-Year(DOB))

which gives me the age of the person on the date I open the database.
How do I make it so it will show the age the runner will be on
3/19/2011?

Thanks!

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: Calculating age on a specific date - 01-04-2011 , 11:27 PM






"lynne" <computer.1on1 (AT) gmail (DOT) com> wrote

Quote:
In my database for a 10K Run I need to calculate the age a runner will
be on 3/19/2011 (using their DOB)

Been using:

Case(Date(Month(DOB);Day(DOB);Year(Modification))> Modification;Year(Modifica
tion)-
Quote:
Year(DOB)-1;Year(Modification)-Year(DOB))

which gives me the age of the person on the date I open the database.
How do I make it so it will show the age the runner will be on
3/19/2011?

Thanks!
You'll probably want to be able to change the deate you're using for the age
test, so the best approach would be to create a new Global Date Field,
e.g. RaceDate Global Date

and put it on a Layout where it's easily accessible. Then for this
particular example type the date "3/19/2011" into the new Field (without the
quote marks).

Then you can create a duplicate of that Field you're using above and change
the Modification Field to be the new RaceDate Field.
i.e.
RaceAge Calculation, Unstored, Number Result
= Case(Date(Month(DOB); Day(DOB); Year(RaceDate))>RaceDate;
Year(RaceDate) - Year(DOB)-1;
Year(RaceDate) - Year(DOB))

Now, whenever you change the RaceDate Field's data, the RaceAge will
recalculate.


Note: These types of database-wide calculations can be quite slow on older
computers. I use to run a similar system for triathlons around 15 years ago
on a Mac Classic. I set the database to open automatically each morning when
the computer was turned on and re-calculate the ages as of "today" ... it
used to take about 20 minutes to go through all the records. On a modern
computer it would probably take closer to 20 seconds for the same number of
records.

Helpful Harry )

Reply With Quote
  #3  
Old   
lynne
 
Posts: n/a

Default Re: Calculating age on a specific date - 01-09-2011 , 02:12 AM



On Jan 4, 9:27*pm, "Your Name" <your.n... (AT) isp (DOT) com> wrote:
Quote:
"lynne" <computer.1... (AT) gmail (DOT) com> wrote in message

news:df046580-beb6-436b-aa21-47c93034861b (AT) j32g2000prh (DOT) googlegroups.com...> In my database for a 10K Run I need to calculate the age a runner will
be on 3/19/2011 (using their DOB)

Been using:

Case(Date(Month(DOB);Day(DOB);Year(Modification))> Modification;Year(Modifica
tion)-

Year(DOB)-1;Year(Modification)-Year(DOB))

which gives me the age of the person on the date I open the database.
How do I make it so it will show the age the runner will be on
3/19/2011?

Thanks!

You'll probably want to be able to change the deate you're using for the age
test, so the best approach would be to create a new Global Date Field,
e.g. * * * RaceDate * * Global * *Date

and put it on a Layout where it's easily accessible. Then for this
particular example type the date "3/19/2011" into the new Field (without the
quote marks).

Then you can create a duplicate of that Field you're using above and change
the Modification Field to be the new RaceDate Field.
i.e.
* * * *RaceAge * * * *Calculation, Unstored, Number Result
* * * * * = *Case(Date(Month(DOB); Day(DOB); Year(RaceDate))>RaceDate;
* * * * * * * * * * * *Year(RaceDate) - Year(DOB)-1;
* * * * * * * * * * * *Year(RaceDate) - Year(DOB))

Now, whenever you change the RaceDate Field's data, the RaceAge will
recalculate.

Note: These types of database-wide calculations can be quite slow on older
computers. I use to run a similar system for triathlons around 15 years ago
on a Mac Classic. I set the database to open automatically each morning when
the computer was turned on and re-calculate the ages as of "today" ... it
used to take about 20 minutes to go through all the records. On a modern
computer it would probably take closer to 20 seconds for the same number of
records.

Helpful Harry *)
Helpful you most certainly were Harry. Funny, was walking along the
ocean this morning and pondering this database age query and the very
obvious (oh silly me) solution came up to make a global date field and
come home and found your answer. You must have tossed it into the
collective consciousness when you replied. Thank you! For of course,
it works perfectly. Many thanks.

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.