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

    Sum query returning incorrect answer

    Hello,

    I have two tables here is my first query Query2:

    SELECT tashkil1.LIN, tashkil1.DESC, tashkil1.QTY, tashkil1.SMCO, Count(tbl_3.lin) AS linx
    FROM tashkil1 LEFT JOIN tbl_3 ON tashkil1.LIN = tbl_3.LIN
    GROUP BY tashkil1.LIN, tashkil1.DESC, tashkil1.QTY, tashkil1.SMCO;

    This is my second query to get the sum for the qty but the addition is wrong:

    SELECT Query2.LIN, Query2.DESC, Sum(Query2.QTY) AS SumOfQTY, Query2.SMCO, Query2.linx
    FROM Query2


    GROUP BY Query2.LIN, Query2.DESC, Query2.SMCO, Query2.linx;


    Any help is appreciated!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Can't see anything wrong with queries. Would have to examine data and test queries. If you want to provide, follow instructions at bottom of my post.
    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: 13
    Last Post: 11-08-2012, 03:49 PM
  2. Replies: 5
    Last Post: 04-24-2012, 10:26 AM
  3. Expression Incorrect in TOTALS query
    By SenSen in forum Queries
    Replies: 0
    Last Post: 02-29-2012, 08:46 PM
  4. Query Data Incorrect
    By Two Gun in forum Queries
    Replies: 8
    Last Post: 01-31-2012, 06:07 PM
  5. Query - Returning ID instead of Value...??
    By Poolio in forum Queries
    Replies: 5
    Last Post: 04-18-2011, 07:10 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