Results 1 to 3 of 3
  1. #1
    cassidym is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    44

    Calculating Sub Totals in a Query

    How do I do sub totals in a query?



    Have designed a personnel database for my customer who is the prime contractor and the main table lists all personnel by name and company. My customer wants the report this query drives to list each person by name and company (there are seven sub contractor companies). Additionally the customers wants the report to show the number of employees from each company. Report wopuld look something like this:

    Name Company Total
    Joe NG 5
    Sam NG
    Ed NG
    Pete NG
    Paul NG
    George Raytheon 2
    Bill Raytheon
    Sally Oracle 3
    Mary Oracle
    Mike Oracle

    Question is how do I get the query to return these sub totals?

    Thanks

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    SELECT sum(Total)
    FROM myTable
    GROUP BY Company

    hope that works. I spaz sometimes on my SQL syntax

  3. #3
    cassidym is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    44
    Thanks will give it a try and let you know how it works.

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

Similar Threads

  1. Query - using Max Totals with Criteria
    By mslieder in forum Access
    Replies: 1
    Last Post: 06-19-2013, 06:02 AM
  2. Adding Totals to a query using queryDef
    By jrickels in forum Programming
    Replies: 7
    Last Post: 04-06-2010, 07:47 AM
  3. Totals in a query-based report
    By babylikesburgh in forum Reports
    Replies: 4
    Last Post: 02-24-2010, 03:08 PM
  4. Replies: 7
    Last Post: 12-07-2009, 07:27 AM
  5. query - totals
    By mslieder in forum Access
    Replies: 0
    Last Post: 02-22-2006, 06:11 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