Multiple counts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wildster
    New Member
    • Feb 2008
    • 16

    Multiple counts

    Hi,

    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
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    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.

    Comment

    • DonRayner
      Recognized Expert Contributor
      • Sep 2008
      • 489

      #3
      Or you can use the DSum() Function

      Code:
      DSum("[Gender]","YourTable", "[Gender] = 'y'")
      Replace YourTable with whatever your table name is.

      Comment

      • Wildster
        New Member
        • Feb 2008
        • 16

        #4
        Thanks guys, big help

        Comment

        Working...