f



Calculating age on a specific date

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!
1
lynne
1/5/2011 4:37:41 AM
comp.databases.filemaker 11032 articles. 0 followers. amosw01 (46) is leader. Post Follow

2 Replies
2122 Views

Similar Articles

[PageSpeed] 26

"lynne" <computer.1on1@gmail.com> wrote in message
news:df046580-beb6-436b-aa21-47c93034861b@j32g2000prh.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  :o)




0
Your
1/5/2011 5:27:50 AM
On Jan 4, 9:27=A0pm, "Your Name" <your.n...@isp.com> wrote:
> "lynne" <computer.1...@gmail.com> wrote in message
>
> news:df046580-beb6-436b-aa21-47c93034861b@j32g2000prh.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(Modif=
ica
> 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. =A0 =A0 =A0 RaceDate =A0 =A0 Global =A0 =A0Date
>
> 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 chan=
ge
> the Modification Field to be the new RaceDate Field.
> i.e.
> =A0 =A0 =A0 =A0RaceAge =A0 =A0 =A0 =A0Calculation, Unstored, Number Resul=
t
> =A0 =A0 =A0 =A0 =A0 =3D =A0Case(Date(Month(DOB); Day(DOB); Year(RaceDate)=
)>RaceDate;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Year(RaceDate) - Year(DOB)=
-1;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Year(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 olde=
r
> computers. I use to run a similar system for triathlons around 15 years a=
go
> on a Mac Classic. I set the database to open automatically each morning w=
hen
> 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 =A0:o)

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.
0
lynne
1/9/2011 8:12:23 AM
Reply: