Results 1 to 3 of 3
  1. #1
    Vanita is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2019
    Posts
    23

    Wrong values in query result

    Helloo there..

    1. I have two tables a.Production plan and b.Production monitoring.
    2. A perticular item is planned for production in table 'a' and the same is monitored in table 'b'(Monitoring: Against planned how many are produced and how many are rejected etc).


    3. In a query am trying to get the difference of 'Planned Qty' and 'Produced Qty", since the resulted diff qty needs to be planned again in table 'a' untill the difference value is =0.
    4. Have designed a query (screen shot attached for reference), no idea for what reason the values are very much wrong.
    5. Please help!

    will share if any other details are required for clarification.
    Attached Thumbnails Attached Thumbnails Presentation1.jpg   Image.jpg  
    Last edited by Vanita; 02-28-2019 at 02:21 AM. Reason: Please ignore the 2nd attachment named 'image'

  2. #2
    Vanita is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2019
    Posts
    23
    Please ignore the 2nd attachment named 'image' attached by mistake.

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    First off, NEVER create calculated fields that use an Alias (name) that is exactly the same as the field names! That can cause all sorts of ambiguity and unexpected results.
    Secondaly, I don't know if you can do the SUMs and the difference of the SUMs in the same query.

    So, first try giving your calculated fields new names, and then update the formula that checks the difference between them.
    If that does still not work, try breaking it up into two queries, and see if that works.
    So, your first query would have the two calculated fields that do the SUM.
    Then the second query would use the first query as its source, and you can subtract the two calculated fields there.

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

Similar Threads

  1. Wrong result
    By Alex Motilal in forum Queries
    Replies: 5
    Last Post: 12-19-2017, 04:12 AM
  2. Replies: 4
    Last Post: 08-01-2016, 06:41 AM
  3. Joining multiple tables get wrong result
    By Tony Thi in forum Queries
    Replies: 3
    Last Post: 10-16-2015, 08:54 AM
  4. Access giving wrong result using sql query
    By amlanroy in forum Access
    Replies: 3
    Last Post: 05-10-2012, 10:11 AM
  5. Replies: 1
    Last Post: 12-20-2011, 03:32 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