Results 1 to 2 of 2
  1. #1
    Sqnwk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    1

    Suming Duplicate Records in Union Query

    Hello

    (Example of my data)

    Order ID Customer ID Purchase Amount
    1 17 $14.95
    1 17 $7.35
    2 21 $11.90
    3 27 $64.80


    3 27 $31.13

    I'm new to access and could use your assistance. I have two tables with pull in data. What I'm looking for is a query that would combine the customers purchase and sum the purchase amount field. The tables are unioned as some customer data is in one table but not the other and joining them excludes some of this data. Ultimately I would like to see is

    Order ID Customer ID Purchase Amount
    1 17 $22.30
    2 21 $11.90
    3 27 $95.93

    Any assistance would be greatly appreciated.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Use the UNION query in a GROUP BY (Totals) aggregate query. Or use the UNION as RecordSource for a report and use report Grouping & Sorting with aggregate calcs in header/footer section. This will allow display of detail records and summary data.
    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. Replies: 1
    Last Post: 09-14-2012, 03:09 PM
  2. Trouble with suming, grouping records
    By mrfixit1170 in forum Programming
    Replies: 1
    Last Post: 02-09-2012, 01:41 PM
  3. Query will duplicate records
    By funkygoorilla in forum Queries
    Replies: 3
    Last Post: 09-29-2011, 01:32 AM
  4. Query by time while suming another column
    By abodi in forum Queries
    Replies: 2
    Last Post: 09-28-2011, 07:56 PM
  5. Union Query Dropping Records
    By Bedsingar in forum Queries
    Replies: 2
    Last Post: 07-18-2011, 09:29 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