Results 1 to 3 of 3
  1. #1
    mrjj is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    1

    How to compare and calculate results of two queries

    I have a table where I have all needed parts for various products to be build. Then I have another table where is listed out parts already in stock) so kind of bookkeeping list.

    How do I get out list of parts still needed to be bought ?

    I have made two queries

    - reference query
    part name, quantity, product name, department

    - part lookup query
    part name, used quantity, product name, department


    So what is needed is a way to lookup both queries, check if lines do match (product name, part name, department) then deduct used quantity from reference quantity.
    If result is negative = something wrong or parts are going somewhere else
    positive = amount to be ordered = missing amount



    Access built in query find unmatched can be used to check if there is not matching lines but now when lines do match except quantites I donīt know how to proceed.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Take the 2 queries and join them at the fields, BUT it needs to be an OUTER join.
    Dbl-click the join line, select ALL RECORDS FROM (qReference query)
    (or switch if needed, opt 2, or 3.)

    This should show whats missing in your list.

  3. #3
    hansendl is offline Advanced Hobbyist
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    38
    Also, FWIW, it sounds like you may have a data normalization issue if you're tracking parts information in two separate tables.

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

Similar Threads

  1. Compare (26) Queries
    By max232 in forum Queries
    Replies: 4
    Last Post: 07-01-2014, 12:30 AM
  2. Results from local function won't compare
    By joethall in forum Queries
    Replies: 1
    Last Post: 07-27-2013, 08:13 AM
  3. Replies: 1
    Last Post: 02-05-2013, 12:15 PM
  4. How to calculate results from two tables ?
    By Nokia N93 in forum Access
    Replies: 1
    Last Post: 02-01-2013, 03:20 PM
  5. Compare player results
    By Andyjones in forum Queries
    Replies: 3
    Last Post: 05-19-2012, 05:59 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