Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count() on a report (2002)

    I should be able to figure this out but I'm stuck.

    On a report I want to count the number of Males (M) in a field called Gender

    I can count all the entries in the field =Count([Gender])

    How do I count all the [Gender] that are = M

    Thanks

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Count() on a report (2002)

    Try this:

    =Abs(Sum([Gender]="M"))

    Explanation: in Access, False = 0 and True = -1.
    The expression [Gender] = "M" is True for males, and False for females.
    So Sum([Gender]="M") counts each male as -1.
    The Abs (absolute value) function removes the minus from the result.

  3. #3
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count() on a report (2002)

    That worked.

    More involved then I expected.

    Thanks Hans.

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •