Results 1 to 3 of 3

Thread: Counting Values in a column

  1. #1
    Join Date
    Apr 2007
    Posts
    21

    Counting Values in a column

    Hello,

    I have a form called feedback which has three columns and each cell in a column has a combo box that holds (Yes/No/Empty), and I want to count each column's value for example let's supposed that:


    feeback number: Column 1 (Are You happy) - Column 2 (Are you sad) - Column 3 (Are you hungry)
    1 : Yes - No - Yes
    2 : Yes - Yes - Yes
    3 : No - No - Yes
    4 : empty - No - yes

    Counting: the next step is that I want to count:

    values in Column 1, where number of Yes =2 , and number of No=1 the stum of Yes + No = 3 and empty = 1
    values in Column 2, where number of Yes =1 , and number of No=3 the stum of Yes + No = 4 and empty = 0
    values in Column 3, where number of Yes =4 , and number of No=0 the stum of Yes + No = 4 and empty = 0


    So, how can I apply this concept in MS ACCESS (2000-2003).

    I am waiting for you kindly reply.
    Attached Images Attached Images

  2. #2
    Join Date
    May 2006
    Posts
    407
    Thanks for the picture, that helps a LOT!
    Total Number of Feedback: =DCount("form_id", "tblYourTable")
    # of Yes(Q1): =DSum("Q1", "tblYourTable", "Q1='Yes')
    # of No(Q1): =DSum("Q1", "tblYourTable", "Q1='No')
    Sum of Q1: =DSum("Q1", "tblYourTable", "Q1='Yes') + DSum("Q1", "tblYourTable", "Q1='No')
    You can do this for each field at the bottom of your form. Be sure to change the "tblYourTable" to the name of your actual table.
    Hope this helps,

  3. #3
    Join Date
    Apr 2007
    Posts
    21

    Hello

    Hello GolferGuy,

    Thanks for your help, it was very useful to learn the DSum Function. Thanks a lot.

Posting Permissions

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