View Full Version : Grouping a calculated field in query


tinynoo
10-29-2008, 07:59 AM
I have a form based on a query which calculates employees ages from the date of birth which in turns derives from a table. I want to be able to analise staff based on their age group, e.g number staff 16-20yrs, number staff 21-25yrs. I know how to group and count but can I create a calculation to show age groups which I can then group thereafter and what would this calculation be?

Brianwarnock
10-29-2008, 08:24 AM
The Count will infacr be a sum.
Assuming that age is already calculated then

Ages10_20:sum(IIf([age]>9 and [age]<21,1))
will give you the count.

If age is being calculated in the query I think that you will have to replace age with that calculation at every point.

Brian

tinynoo
10-30-2008, 06:29 AM
Many thanks, I will give this a shot.:)