The advice you offered worked, however, it did not give me what I really
wanted because I did not explain my question well enough. Here’s my second
attempt.
I have 2 tables of data that is identical information.
Warehouse
Item Number
Amount on Hand
Table 1 is [Month End Query 1] and has 58 records, of which 50 match table 2.
Table 2 is [Month End Query 2] and has 56 records, of which 50 match table
1.
I need a query/report that lists all the records for each table as a
comparison. I am comparing 2 separate lists as a part of month inventory
cross check, with the idea to find where the 2 tables differ. Table 1 is a
spreadsheet where we track our inventory “liveâ€, and we only list those items
that are actually in stock/on order for that warehouse. Table 2 is a AS400
query with all items, no matter the balance on hand.
The report would look something like this:
WAREHOUSE ITEM # AMOUNT 1 AMOUNT 2
BR 500-50-ST 20,000 25,000
BR 300-50-ST 20,000 20,000
CC 500-50-ST 20,000 0
CC 300-50-ST 20,000 0
DD 500-50-ST 0 25,000
In this case, Amount 1 would come from [Month End Query 1] and Amount 2
would come from [Month End Query 2].
My problem is that I can’t figure out how to join the two tables in the
query. If I join from the left, I get 58 records from table 1, with an equal
number of records from table 2, but I am missing the 6 records from table 2
that do not match table 1.
I hope that I have clarified my situation better and hope even more that
someone can help me.
Thanks for your time and effort.
Marshall Barton said:
Mike C said:
When I used the following union query, I received an error message saying
"Snytax Error (missing operator) in query expression:
SELECT Month End query 1.F1, Month End query 1.F2 AS F2A, Month End Query
2.F2 AS F2B
FROM Month End query 1 LEFT JOIN Month End Query 2
ON Month End query 1.F1 = Month End Query 2.F1
UNION SELECT Month End Query 2.F1, Month End query 1.F2, Month End Query 2.F2
FROM Month End query 1 RIGHT JOIN Month End Query 2
ON Month End query 1.F1 = Month End Query 2.F1
ORDER BY F1;
When you use spaces or other funky characters in a name, you
must enclose the name in [ ]
SELECT [Month End query 1].F1, . . .