J
Janna
Not sure the best way to accomplish this. ANY help is appreciated.
My database has a table called tblClient. In the table I have the following
fields ID, FirstName, LastName, DOB and DateAppt. Thanks to help from the
Access Forms Coding, using the DOB, I can calculate the age of the client in
years from the date of initial appointment [DateAppt] using the following
code in a query that refers to a function called AgeYears
AgeInYears: AgeYears([Dob],[DateAppt]
I now need to break the clients down into age groups, by years. For
example, I need to know in 2003 how many were 15 years or younger and how
many were over the age of 15, the same for 2004 and 2005. I’d really like to
be able to do this by using the values that I calculated above in my
AgeInYears field, but I’m not having any luck.
If I put an additional field into tblClient called AgeofYouth and manually
type in the age.
I can accomplish what I want by using a multi-table query, with a second
table having fields:
Age Group Name 15AndYounger Over15
Minimum 0 16
Maximum 15 20
Into the same query, I add my tblClient, using the ID and AgeofYouth fields.
On the ID Total field, I use “Count†and the Ageof Youth Total field, I use
“Where†and in the Criteria I put “Between [Minimum] and [Maximum]
It gives me the values I want, it’s just not a very clever way of doing
it—here I have the system calculate the age, but I can’t seem to use the
value, once I have it, to break down the clients into groups without manually
entering the calculated age into an additional field. There’s got to be a
better way!!
My database has a table called tblClient. In the table I have the following
fields ID, FirstName, LastName, DOB and DateAppt. Thanks to help from the
Access Forms Coding, using the DOB, I can calculate the age of the client in
years from the date of initial appointment [DateAppt] using the following
code in a query that refers to a function called AgeYears
AgeInYears: AgeYears([Dob],[DateAppt]
I now need to break the clients down into age groups, by years. For
example, I need to know in 2003 how many were 15 years or younger and how
many were over the age of 15, the same for 2004 and 2005. I’d really like to
be able to do this by using the values that I calculated above in my
AgeInYears field, but I’m not having any luck.
If I put an additional field into tblClient called AgeofYouth and manually
type in the age.
I can accomplish what I want by using a multi-table query, with a second
table having fields:
Age Group Name 15AndYounger Over15
Minimum 0 16
Maximum 15 20
Into the same query, I add my tblClient, using the ID and AgeofYouth fields.
On the ID Total field, I use “Count†and the Ageof Youth Total field, I use
“Where†and in the Criteria I put “Between [Minimum] and [Maximum]
It gives me the values I want, it’s just not a very clever way of doing
it—here I have the system calculate the age, but I can’t seem to use the
value, once I have it, to break down the clients into groups without manually
entering the calculated age into an additional field. There’s got to be a
better way!!