Results 1 to 5 of 5
  1. #1
    E1202413 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7

    Query Results being Multiplied

    I am trying to link multiple tables to show in one output but sometimes the numbers are being doubled, tripled or more. It is not on every line only some.

    SELECT [CER Master List].[Approved/Closed], [CER Master List].[CER #], [CER Master List].Description, [CER Master List].Date, [CER Master List].GBU, [CER Master List].Location, [CER Master List].[CER Contact], [CER Master List].[Budget Amount], Sum([2014 Assets YTD].Amount) AS SumOfAmount, Sum([2014 GL Detail].Amount) AS SumOfAmount1, Sum([2014 YTD Capital Co 60].[updated amount]) AS [SumOfupdated amount], Sum([2014 YTD Assets Co 60].[updated amount]) AS [SumOfupdated amount1]
    FROM ((([2014 Assets YTD] RIGHT JOIN [CER Master List] ON [2014 Assets YTD].SLN = [CER Master List].[CER #]) LEFT JOIN [2014 GL Detail] ON [CER Master List].[CER #] = [2014 GL Detail].SLN) LEFT JOIN [2014 YTD Capital Co 60] ON [CER Master List].[CER #] = [2014 YTD Capital Co 60].SLN) LEFT JOIN [2014 YTD Assets Co 60] ON [CER Master List].[CER #] = [2014 YTD Assets Co 60].SLN
    GROUP BY [CER Master List].[Approved/Closed], [CER Master List].[CER #], [CER Master List].Description, [CER Master List].Date, [CER Master List].GBU, [CER Master List].Location, [CER Master List].[CER Contact], [CER Master List].[Budget Amount];


    I am taking some base data and retreiving amounts from 4 different tables. See the first line for #100323 this should be $21,700 and $2212.49.
    But #100782,101016,101352...etc are all correct. Any help??

    Click image for larger version. 

Name:	Query.PNG 
Views:	10 
Size:	47.4 KB 
ID:	18723

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    This happens when query includes multiple tables that are the 'many' side of a relationship to another table.

    Need to do aggregate queries on the 'many' side tables first. Then join those queries to the 'master' they relate to.
    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
    E1202413 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    Sorry...I'm new at this? How exactly would I do this? Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Use the query builder. This is basic Access functionality. Access Help has guidelines for using the query builder and building aggregate (Totals GROUP BY) queries. There are lots of tutorials on the web. I don't want to write a tutorial here in post. For a start review http://www.opengatesw.net/ms-access-...ess-Query2.htm

    Build and save query objects then use those queries like tables in another query.
    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.

  5. #5
    E1202413 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    I didn't know I could use a query as a table. This works now. Thanks for the help!

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

Similar Threads

  1. Replies: 1
    Last Post: 09-29-2014, 03:35 PM
  2. Replies: 5
    Last Post: 05-21-2013, 02:21 PM
  3. Replies: 3
    Last Post: 05-02-2013, 10:36 AM
  4. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  5. Query Issues: Multiplied Results
    By Sa'El in forum Access
    Replies: 1
    Last Post: 09-12-2011, 09:46 AM

Tags for this Thread

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