Results 1 to 2 of 2
  1. #1
    noobaccessuser is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    1

    Query to Sum Values and Remove Duplicates

    Hello!

    I am trying to make a query (or even a macro if need be) to add up the different weights for each order number while removing duplicates of the order number. I know it's really confusing so here's an example:

    Order Number Consignee Tracking Weight
    242567 Joe Turner 54A52 16
    242567 Joe Turner 54A52 13
    243555 Frank Smith 53B42 5
    243555 Frank Smith 53B42 6
    243555 Frank Smith 53B42 4

    That's basically how the data is sorted at this time. The end result should look like:

    Order Number Consignee Tracking Weight
    242567 Joe Turner 54A52 29


    243555 Frank Smith 53B42 15


    I've thought and ran every possible Query I could unfortunately I can't get it to work.

    Thank you all for your help!!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Looks like you need a GROUP BY (Totals) aggregate query.

    SELECT [Order Number], Consignee, Tracking, Sum(Weight) AS SumWeight GROUP BY [Order Number], Consignee, Tracking;

    Or build a report using Grouping & Sorting with aggregate calcs functionality.
    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. remove Left Join duplicates
    By lokiluke in forum Queries
    Replies: 2
    Last Post: 09-16-2011, 04:53 AM
  2. Remove Duplicates Based on Criteria
    By suryaprasad in forum Access
    Replies: 0
    Last Post: 04-07-2011, 10:50 PM
  3. Replies: 2
    Last Post: 08-17-2010, 02:58 PM
  4. How to remove duplicates
    By TonyBender in forum Access
    Replies: 0
    Last Post: 10-21-2009, 10:27 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