Results 1 to 7 of 7
  1. #1
    Join Date
    May 2011
    Posts
    3

    Question Multiple counts/sums needed

    Hi, I write the MS 2003 queries for my group and am completely self-trained. I'm having trouble writing a query for which I need the following summations:



    By different Coordinator (employee), I need a count of how many requests each coordinator has for each state. Here are my fields:

    ESC (the coordinator ee)
    ISRN (a unique number assigned to an event)
    RST (the state in which the event was held)
    DRR (the date the request was received)

    Let's say I'm one of the ESCs. My name is Cindy. I would need to know how many ISRNs Cindy has for each of the 50 states.

    I'm sure this will be simple for someone, but I've tried grouping, counting and summing and all to no avail. Any assist will be most appreciated. Thank you!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Did you try building a report using Grouping & Sorting and summary calcs in group footers?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    May 2011
    Posts
    3
    I just started to look at reports because it seemed as though I was asking my query to do many calculations; thank you. Being self taught, I have much to learn. Thanks for pointing me in the right direction.

  4. #4
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    Let's say I'm one of the ESCs. My name is Cindy. I would need to know how many ISRNs Cindy has for each of the 50 states.
    This should work:

    SELECT a.ISRNs, Count(RST)
    FROM TableA as a
    WHERE a.ESC = 'Cindy'
    GROUP BY a.ISRNs

  5. #5
    Join Date
    May 2011
    Posts
    3
    Thank you, Rixxe. I'm clearly in over my head ... no idea to do with the info you gave me. I tried to copy and paste it in the SQL view but received a lot of errors. ... wish my company would pay for me to get some training. Ugh!

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    When you took Rixxe's SQL statement and pasted it into a Query, did you bother to change the table names from TableA to reflect your table name? If not, then Access would not know where to get the data from.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    That query will produce summary data but if you want to see the details of records that contribute to the summary, should build report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Counts in reports
    By beejay101 in forum Reports
    Replies: 2
    Last Post: 05-16-2011, 11:02 PM
  2. Replies: 2
    Last Post: 05-05-2011, 12:41 PM
  3. How do I sum multiple sums?
    By RobRay in forum Reports
    Replies: 6
    Last Post: 11-26-2010, 08:48 PM
  4. sql for grouping and counts
    By TheShabz in forum Queries
    Replies: 2
    Last Post: 11-04-2010, 02:01 PM
  5. Sums of Multiple Queries
    By flsticks in forum Queries
    Replies: 5
    Last Post: 09-16-2010, 09:32 AM

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