Results 1 to 4 of 4
  1. #1
    alhareri is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    6

    how to sum multi fields with one criteria

    hi every one
    how to sum multi fields with one criteria for example:


    i have form
    with 5 fields all the fields has the same choice A,B,C,D
    i want to count how many A in all 5 fields
    or how many B in all 5 Fields and so on
    thanks
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    make 1 query to sum the fields, but the last field sums ALL":
    select sum(a), sum(b), sum(c), sum(d), (sum(a)+ sum(b)+ sum(c)+ sum(d)) from table

    or do it in 2 queries:
    Q1 to sum the fields
    Q2 to Total all together from Q1

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you are using this as a scoring mechanism I would attach the A B C D E values to what their score means rather than trying to count how many of an item there are. Otherwise you'll be stuck doing something like

    ACount: iif([1]='a',1)+iif([2]='a',1)+iif([3]='a',1)+iif([4]='a',1)+iif([5]='a',1)

    and doing something similar for each discrete value in your list (you have 10 values or so) so it would be quite ponderous. The other option is to turn this data into a normalized structure.

  4. #4
    alhareri is offline Novice
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    6
    thanks for you it is work fine

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multi field criteria
    By sharonir22 in forum Queries
    Replies: 14
    Last Post: 07-02-2015, 03:04 PM
  2. How do I return a value on multi criteria?
    By smc678 in forum Access
    Replies: 5
    Last Post: 11-20-2012, 02:35 PM
  3. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  4. Dlookup with multi Criteria
    By rkalapura in forum Forms
    Replies: 2
    Last Post: 06-15-2012, 06:18 PM
  5. Multi Criteria Query
    By hawkins in forum Queries
    Replies: 1
    Last Post: 07-18-2011, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums