Query to get non-matching results (1 Viewer)

princeofdumph

Registered User.
Local time
Today, 04:53
Joined
Mar 21, 2009
Messages
12
Hi,

I have created two simple queries. One shows the complete order details of a customer i.e. all the ordered products' names and their order value. The other query shows me the products that have been invoiced against those order numbers. I want to build a query that gives me the order details i.e. product names and order values that have not yet been invoiced. However, while using the 'find unmatched items query' from Access query wizard, i am still unable to get the desired result i.e. to show only those items of an order that have not yet been invoiced or partially invoiced.

Can some one help me on achieving this result without going into VBA. Thanks.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:53
Joined
May 7, 2009
Messages
19,230
take the two Queries you have and join them using
Left Join. Test for blank Order Number and/Or Product Number.
blank means it has no Invoice yet, eg:

SELECT [OrderID], [ProductCode] From yourQuery1 LEFT JOIN
yourQuery2 ON yourQuery2.[OrderID] = yourQuery1.[OrderID]
AND yourQuery2.[ProductID] = yourQuery1.[ProductID]
WHERE yourQuery2.[OrderID] Is Null;"

yourQuery1 and yourQuery2 means the queries you
mentioned on your post in sequence when you
mentioned them.
 

Users who are viewing this thread

Top Bottom