Counting # of records in age groups

  • Thread starter Thread starter vcapy
  • Start date Start date
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.
 
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...
 
Back
Top