Counting # of records in age groups

V

vcapy

I am trying to create a text box's that will contain
counts age groups of all of the records in my Demographics
table. For instance, I want a count of clients <19, 19-
35, 36-45, etc. What type of formula would I need to do
this. I have already created the query that has produced
age from DOB. I have been using Dcount, but I can't seem
to get the criteria right.
 
D

Duane Hookom

I would create a simple function and place it in a module basAgeCalcs

Function GetAgeGroup(intAge as Integer) as String
Select Case intAge
Case is <19
GetAgeGroup = "<19"
Case is <=35
GetAgeGroup = "19-35"
Case is <=45
GetAgeGroup = "36-45"
etc
End Select

End Function

Use can use this function in a control source or query or code...
 

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