How do I get M and F totals for a Gender field in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm a new Access 2003 user, working with a file of over 500,000 records. I'm
wanting to determine how many Males and how many Females from a Gender field
and can't figure out how to do this seemingly simple task.
Thanks.
 
=IIf(Count([GenderField])="M","Total Males"&" "&[GenderField]),)
=IIf(Count([GenderField])="F","Total Females"&" "&[GenderField]),)
 
SELECT tblEmployees.Gender, Count(tblEmployees.Gender) AS GenderCount
FROM tblEmployees
GROUP BY tblEmployees.Gender
ORDER BY tblEmployees.Gender;
 
Thank you to Wayne and Jerry for responding.

I actually was able to do what I needed by following the directions of Ed
Warren from someone else's inquiry:

1. Open the query designer
2. Add your table to the designer
3. Add the field 'gender'
4. Add the primary key field, e.g., "id"
5. Select the Groupby (totals) icon (sigma)
6. Under 'gender' select "Groupby"
7. Under ID select "Count"
8. Run the query
It returns a count of the number of each gender in the database

9. For even more specific information from your table, add another field,
e.g., "race"
10. Run the query

Now it returns a row for each combination of 'gender' and 'race' with a
count of the number of records in the 'group'

This worked for me!!! YAY!! and thanks.
 
Back
Top