By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,481 Members | 3,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,481 IT Pros & Developers. It's quick & easy.

Multiple counts

P: 16

How can you count x and y as seperate counts from the same field?

i.e. A table has the field Gender and I want to have one count which counts the number of records with 'male' as the gender' and another count which counts 'female' as the gender?

Any help will be very much appreciated
Feb 6 '09 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,287
Make a query and set it to Totals. Add the Gender field and set Total: Group By, then add the Gender field again and set Total: Count.
Feb 6 '09 #2

Expert 100+
P: 489
Or you can use the DSum() Function

Expand|Select|Wrap|Line Numbers
  1. DSum("[Gender]","YourTable", "[Gender] = 'y'")
Replace YourTable with whatever your table name is.
Feb 6 '09 #3

P: 16
Thanks guys, big help
Feb 9 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.