Age Calculation Problem

S

Sharmalee

I am having some difficulties getting Access to correctly calculate
the correct age for some of my research participants.

The formula I have to compute the age is: =([DOE]-[Birthdate])\365.25

In this particular incidence the person’s birth date is 11/11/34 and the
Date of Exam is 10/26/2004. The age should come up as 69 because they did
not have their birthday until after the testing date. Access is computing
the age to be 70.

I tried putting in some different testing dates. A testing date of
10/23/04 shows the age on date of testing to be 69. A testing date of 10/24
and following shows the age on the date of testing to be 70. It seems that
the computer is randomly choosing a date to round-up to the next age even
though the birthday has not happened yet. Is there any way to correct this?

Format is “Fixedâ€. I got the same calculations when I tried changing
format to “Standardâ€

Decimal places is "2†but I get the same calculations when I change decimal
places to “0†or to "auto".
 
R

Rick B

As posted many times (you could always do a search) the proper formula to
calculate age is:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))
 
R

Rick B

Note that you can replace the current date "Date()" in my previous post with
your field "DOE".

Rick B
 
M

Mike Painter

Sharmalee said:
I am having some difficulties getting Access to correctly
calculate the correct age for some of my research participants.

The formula I have to compute the age is: =([DOE]-[Birthdate])\365.25

In this particular incidence the person's birth date is 11/11/34 and
the Date of Exam is 10/26/2004. The age should come up as 69 because
they did not have their birthday until after the testing date.
Access is computing the age to be 70.

I tried putting in some different testing dates. A testing date of
10/23/04 shows the age on date of testing to be 69. A testing date
of 10/24 and following shows the age on the date of testing to be 70.
It seems that the computer is randomly choosing a date to round-up to
the next age even though the birthday has not happened yet. Is there
any way to correct this?

Others have posted a much better way to calculate age.
Your solution fails near the actual date for several reasons. Mainly it's
that while there are about 365.25 days in a year we use leap years every
four years, with an exception and that exception has an exception.

You're lucky you caught it early on. Normally the dates have to be closer
together to toss that error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top