Calculate age category from birthdate

M

Ms. C.

Please, can someone help me by telling me how to write three expressions I
need? I'd deeply appreciate it!!

I have a library database containing information on families who have signed
up for our mailing list. Each record represents a family, and may contain
birthdates and e-mail addresses for up to 8 children. Each record also
contains mailing address fields and a yes/no opt-in for postal mail, as well
as other related information. The birthdate fields have sequential names like
"Child 1 Birthdate."

I want to calculate the children's ages from their birthdates, and use their
ages to calculate yes/no fields for different mailing lists. For example,
"Family has infant?" should set itself to "Yes" if ANY child is age 0-12
months. "Family has young adult?" should set itself to "Yes" if ANY child is
age 13-18. (There are 5 age-based categories.) My goal is to then use these
calculated fields in queries, mail merges, etc. so we send mailings only to
the right families.

My questions:
1. What expression should I put in each child's "Child 1 Age" field to
calculate the age based on the "Child 1 Birthdate" field? My attempts to use
the =Datediff function haven't been successful. :(

2. What expression should I put in the "Family has infant?" field to set it
to "Yes" if ANY of the 8 children are ages 0 to 12 months?

3. What expression should I put in the "Family has young adult?" field to
set it to "Yes" if ANY of the 8 children are ages 13 to 18 years?

I should be able to edit the expressions to make the other age category
yes/no fields work, if these two are right.

If anyone can help with this, you'll have a very happy youth services
library lady in your debt! I would REALLY appreciate any input!

Thank you very much for taking the time to respond.
 
T

tina

recommend you stop where you are, and redesign your table(s) to meet
normalization rules. with the flat-file design you've described, you're
going to go crazy trying to do the simplest tasks in Access, which is
designed to support data that is relationally structured - NOT flat file
data. for more information, see
http://home.att.net/~california.db/tips.html#aTip1.

hth
 
T

tina

thank you, Keith :)
yes, it is my website. but there's nothing original about anything in it,
neither ideas nor code - just a compilation of basic "wisdom" for newbies,
that can also be found in many other places in print and on the internet,
including these newsgroups, of course. i created the site as a required
project in a basic web design class i took last year, and with the intention
to use it as a quick reference to advice that i had found myself writing
over and over in response to questions in these newsgroups. it doesn't
aspire to be anything more than that, and in that context, credibility is
not an issue - so no worries! :)
 
K

Keith Wilby

tina said:
thank you, Keith :)
yes, it is my website. but there's nothing original about anything in it,
neither ideas nor code - just a compilation of basic "wisdom" for newbies,
that can also be found in many other places in print and on the internet,
including these newsgroups, of course. i created the site as a required
project in a basic web design class i took last year, and with the
intention
to use it as a quick reference to advice that i had found myself writing
over and over in response to questions in these newsgroups. it doesn't
aspire to be anything more than that, and in that context, credibility is
not an issue - so no worries! :)

Duly noted, thanks.

Keith.
 

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