Results 1 to 2 of 2
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    318

    DSum in Query - Adding groups

    I have a table with a list of buildings, I have another table with a list of Posts. I have both of these tables connected by a third table.



    I ran a query that gives me a list of combined information including Building Number, Post Number and a Inspection Number from the Post table.

    I want to add up the Inspection Numbers for each Building. I thought I could use a DSum but I can't seem to get it to work.

    See the attached

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    if you want to group a column, like building numbers and use a mathematical operation on them, you have to group it with an aggregate function, NOT a domain aggregate, so try something like:

    Code:
    select buildingnum, sum(otherfield) as [sum of grouped building codes] from table
    
    group by buildingnum
    domain aggregates (e.g. - those that start with 'D' and do math stuff) don't ever need GROUP BY clauses.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-27-2010, 06:58 AM
  2. Replies: 1
    Last Post: 05-05-2010, 01:54 AM
  3. Query showing averages for groups
    By AnthonyTesta in forum Queries
    Replies: 1
    Last Post: 02-03-2010, 09:04 PM
  4. Group & Reports (more than 4 Groups??)
    By JohnS in forum Reports
    Replies: 3
    Last Post: 10-01-2009, 07:11 AM
  5. using date for groups
    By antcox2004 in forum Reports
    Replies: 3
    Last Post: 01-28-2006, 07: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