D
Darrell Childress
I have a table that has the following fields
item
location
qty
Many items are in multiple locations (SBC and COMP). I am trying to
write a query that will produce all records where [location] = COMP and
only those records (items) at location SBC where there is not a record
for that item at location COMP. By the way, it might be worth mentioning
that every item has an entry for location SBC, but only certain items
have an entry for location COMP. In the example below, I would want to
exclude record 1 because it also exists in location COMP (record 2). I
would want to INCLUDE record 3 because it does not exist in location COMP.
Item Location Qty
123 SBC 0
123 COMP 5
254 SBC 6
365 COMP 4
As I'm writing this, it occurred to me that I may have to do this in 2
queries, the first simply setting the criteria of location = COMP and
then do an unmatched query???..and then possibly a UNION query of the 2
Thanks for any help,
Darrell
item
location
qty
Many items are in multiple locations (SBC and COMP). I am trying to
write a query that will produce all records where [location] = COMP and
only those records (items) at location SBC where there is not a record
for that item at location COMP. By the way, it might be worth mentioning
that every item has an entry for location SBC, but only certain items
have an entry for location COMP. In the example below, I would want to
exclude record 1 because it also exists in location COMP (record 2). I
would want to INCLUDE record 3 because it does not exist in location COMP.
Item Location Qty
123 SBC 0
123 COMP 5
254 SBC 6
365 COMP 4
As I'm writing this, it occurred to me that I may have to do this in 2
queries, the first simply setting the criteria of location = COMP and
then do an unmatched query???..and then possibly a UNION query of the 2
Thanks for any help,
Darrell