Results 1 to 3 of 3

Thread: DCount??

  1. #1
    Join Date
    Mar 2003
    Location
    Hasselt, Belgium
    Posts
    3

    Post Unanswered: DCount??

    Hi!

    I have an Access table with member details, including their gender (yes/no field type - yes for male).

    I want to use the DCount function to get the number of female members.

    When i enter this expression i get the total number of members:

    DCount("[gender]";"Members")

    Now to get just the female members i add criteris "No"

    DCount("[gender]";"Members";No) - but this returns a result of 0 which is incorrect. The stange thing is that if i enter criteria "Yes" i get the total number of members and not males.

    What i'm trying to accomplish eventually is to calculate the percentage of female members. "female members/total members*100" so i need the number of females so i can use this equation.

    Anyone have any ideas? I'd really appreciate the help.

    P.S. I'd like to solve this with just a simple select query and no SQL statements

  2. #2
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Try using this, for count of females:
    Code:
    DCount("gender","Members","gender=0")
    or this, for count of males
    Code:
    DCount("gender","Members","gender=-1")

  3. #3
    Join Date
    Mar 2003
    Location
    Hasselt, Belgium
    Posts
    3

    Re: DCount??

    Thanks to all who tried to help
    This i show i eventually managed to solve it:

    1st column
    Field: Gender
    Total: Group By
    Criteria: No

    2nd column
    Field: Total members: DCount(“[MemberID]”;”Members”)
    Total: Expression

    3rd column
    Field: Total female: MemberID
    Total: Count

    4th comumn
    Field: Percentage: Format([total members]/[total female];”Percentage”)
    Total: Expression

Posting Permissions

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