trulyblessed
Programmer
I'm trying to find records that for a certain NDC, their quantities do not equal what is on another table. So, for table1, I could have:
NDC Qty
123456789 1
123456789 6
123456789 12
I'm linking to table2 on NDC and table 2 could have:
NDC Qty
123456789 6
123456789 12
I want the query to return all of the fields from table1, for NDC 123456789 where the qty was 1, but what I'm finding is happening in the way that I'm doing it, is it's returning a record for all three of the quantities because there's a record where qty of 1 didn't equal 6 or 12 and qty of 6 didn't equal 12 and where qty 12 didn't equal 6.
How can I write the query so that it only returns rows from table 1 where for that NDC, the quantity wasn't listed in table2 at all??
Thanks,
Kim
NDC Qty
123456789 1
123456789 6
123456789 12
I'm linking to table2 on NDC and table 2 could have:
NDC Qty
123456789 6
123456789 12
I want the query to return all of the fields from table1, for NDC 123456789 where the qty was 1, but what I'm finding is happening in the way that I'm doing it, is it's returning a record for all three of the quantities because there's a record where qty of 1 didn't equal 6 or 12 and qty of 6 didn't equal 12 and where qty 12 didn't equal 6.
How can I write the query so that it only returns rows from table 1 where for that NDC, the quantity wasn't listed in table2 at all??
Thanks,
Kim