Results 1 to 4 of 4
  1. #1
    accessapprentice is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Location
    Los Angeles
    Posts
    2

    Incorrect Sum Totals on Single Field for Certain Records

    Hello All,



    I am writing in regards to a question I cannot seem to solve.

    I have joined two tables (the names of which have been changed for privacy reasons), well call "Sales" and "Purchases". It is a Many-to-One join on the field 'SKU' with a Left Join of "Sales" table to "Purchases" table.
    ***FYI 'GROUP' and 'GROUP DESC' fields have also been changed from real field names for privacy reasons.

    The problem I am having is that the field "Sales Units" is summing incorrect, overinflated totals for certain 'SKUs'. This isn't the case for all fields, but this one in particular.





    I am not sure if it has anything to do with the datatypes of the fields. Datatypes are as follows:

    SALES TABLE
    SKU = Number, Long Integer (GROUP BY)
    SKU DESC= Text (GROUP BY)
    "GROUP"= Number, Long Integer (GROUP BY)
    CHANNEL= Text (GROUP BY) Criteria: "Stocked"
    SALES UNITS = Number, Long IntegerRETAIL PRICE = Number, Double (SUM)
    RETAIL PRICE = Number, Double (AVG)

    PURCHASES TABLE
    "GROUP DESC"= Text, @ (GROUP BY)
    COST(EA) = Currency, $* #,##0.00;$* (#,##0.00);$* -00 (AVG)





    Any thoughts?

    Thank you for your help
    Last edited by accessapprentice; 09-29-2015 at 12:19 PM. Reason: Totals updated

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is it possible those SKU's are duplicated in the "one" table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    accessapprentice is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Location
    Los Angeles
    Posts
    2
    Yes, this actually seems to be the issue.

    For example, we have a SKU #12965.
    In the query I performed, the total 'SumOfSALES UNITS' was = 311,682
    When I filtered and pulled all the records from the "Sales" table and did a sum in excel, I got a sum total of 14,842 for field 'SALES UNITS'.

    When I searched the 'Purchases Table' I got 21 records. 14842 x 21 = 311682.

    I am still trying to figure out how to remedy this, but now I understand. Thank you!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What is the purpose of the purchases table? If it records purchases, that would imply that there have been 21 purchases. I guess the question is why that table is included in your query if you don't expect a record for each. You called it a "one" table, but apparently it's not. Generally the "one" table would be a products table that had one record for each SKU.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 04-04-2013, 11:59 AM
  2. Data incorrect from lookup field
    By lkevinc42036 in forum Access
    Replies: 2
    Last Post: 08-09-2012, 05:25 PM
  3. Expression Incorrect in TOTALS query
    By SenSen in forum Queries
    Replies: 0
    Last Post: 02-29-2012, 08:46 PM
  4. Replies: 11
    Last Post: 09-27-2011, 07:19 AM
  5. Replies: 5
    Last Post: 08-29-2011, 05:17 PM

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