Calculate age

  • Thread starter Thread starter Irv Brand
  • Start date Start date
I

Irv Brand

I have a database of clients that includes a birthdate
field formatted numerically as mm/dd/yyyy. I want to
calculate clients' ages and then run a report of all
clients age 65 and over.
 
You should probably change your birthdate field to an
actual date/time field. Format as mm/dd/yyyy.
Then create a query - add in the birthdate field. Create
a new field called AGE. Enter the following formula in
the age field:
Age: (Now()-[Birthdates])/365
The query will list the ages (in years). To look for only
those people over 65 enter >65 in the criteria row of the
age field.
Good Luck!
Liz McCracken, MOS
 
Irv,

Make a new calculated field in a query, like this...
Age:
DateDiff("yyyy",[BirthDate],Date())+(Format([BirthDate],"mmdd")>Format(Date(),"mmdd"))
.... and then in the criteria row of this field, put >=65

- Steve Schapel, Microsoft Access MVP
 
Sorry, Liz, but there would be a problem with this. There are not 365 days
in every year. By the time someone is 65 years old this will report the age
incorrectly about 15 days out of the year. Datediff, as in Steve's
response, will not have this problem

--
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - your one stop database experts
Liz McCracken said:
You should probably change your birthdate field to an
actual date/time field. Format as mm/dd/yyyy.
Then create a query - add in the birthdate field. Create
a new field called AGE. Enter the following formula in
the age field:
Age: (Now()-[Birthdates])/365
The query will list the ages (in years). To look for only
those people over 65 enter >65 in the criteria row of the
age field.
Good Luck!
Liz McCracken, MOS
-----Original Message-----
I have a database of clients that includes a birthdate
field formatted numerically as mm/dd/yyyy. I want to
calculate clients' ages and then run a report of all
clients age 65 and over.
.
 
If you only need to know if a client is 65 or older and don't need to know
their exact age, you could simply place a criteria like this on your
birthdate field (assuming it's a Date/Time field):

<=DateAdd("yyyy",-65,Date())
 
You're right, and I stand corrected...thanks for the eye
opener!
Great thing about this website...always something new to
find out.
-----Original Message-----
Sorry, Liz, but there would be a problem with this. There are not 365 days
in every year. By the time someone is 65 years old this will report the age
incorrectly about 15 days out of the year. Datediff, as in Steve's
response, will not have this problem

--
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - your one stop database experts
Liz McCracken said:
You should probably change your birthdate field to an
actual date/time field. Format as mm/dd/yyyy.
Then create a query - add in the birthdate field. Create
a new field called AGE. Enter the following formula in
the age field:
Age: (Now()-[Birthdates])/365
The query will list the ages (in years). To look for only
those people over 65 enter >65 in the criteria row of the
age field.
Good Luck!
Liz McCracken, MOS
-----Original Message-----
I have a database of clients that includes a birthdate
field formatted numerically as mm/dd/yyyy. I want to
calculate clients' ages and then run a report of all
clients age 65 and over.
.


.
 
Dear Liz:

I appreciate your attitude very much! I approach making such a correction
with some trepidation, as not everyone would accept this well, let alone
appreciate it. Of course, it was meant to benifit you as well, as I
certainly hope it will!
--
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - your one stop database experts

Liz McCracken said:
You're right, and I stand corrected...thanks for the eye
opener!
Great thing about this website...always something new to
find out.
-----Original Message-----
Sorry, Liz, but there would be a problem with this. There are not 365 days
in every year. By the time someone is 65 years old this will report the age
incorrectly about 15 days out of the year. Datediff, as in Steve's
response, will not have this problem

--
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - your one stop database experts
Liz McCracken said:
You should probably change your birthdate field to an
actual date/time field. Format as mm/dd/yyyy.
Then create a query - add in the birthdate field. Create
a new field called AGE. Enter the following formula in
the age field:
Age: (Now()-[Birthdates])/365
The query will list the ages (in years). To look for only
those people over 65 enter >65 in the criteria row of the
age field.
Good Luck!
Liz McCracken, MOS
-----Original Message-----
I have a database of clients that includes a birthdate
field formatted numerically as mm/dd/yyyy. I want to
calculate clients' ages and then run a report of all
clients age 65 and over.
.


.
 
Thank you so much for your reply. Using your suggestion
and those of others I now have my report. Sorry it took
so long to thank you but I had a hard time finding my
original message.
-----Original Message-----
Irv,

Make a new calculated field in a query, like this...
Age:
DateDiff("yyyy",[BirthDate],Date())+(Format ([BirthDate],"mmdd")>Format(Date(),"mmdd"))
.... and then in the criteria row of this field, put >=65

- Steve Schapel, Microsoft Access MVP


I have a database of clients that includes a birthdate
field formatted numerically as mm/dd/yyyy. I want to
calculate clients' ages and then run a report of all
clients age 65 and over.

.
 
-----Original Message-----
If you only need to know if a client is 65 or older and don't need to know
their exact age, you could simply place a criteria like this on your
birthdate field (assuming it's a Date/Time field):

<=DateAdd("yyyy",-65,Date())




.
Thank you so much for your reply. Using your suggestion
I now have my report. Sorry it took so long to thank you
but I had a hard time finding my original message.
 
Back
Top