Skip to content
Advertisement

Access – Multiple Criteria On Multiple Fields – Only Exclude Specific Match

Example

Sku     Qty
Apple   1
Orange  1
Apple   3
Orange  4

I want to exclude anything that is Exactly Orange* with a qty of 1.

If I do

WHERE ((QTY)>1) AND ((SKU) NOT "Orange")

the result would be:

Apple   3

I need the result:

Sku     Qty
Apple   1
Apple   3
Orange  4

Advertisement

Answer

If I assume that you really mean “not orange with quantity 1”, then use;

where not (sku = "Orange" and qty = 1)

This is logically equivalent to:

where sku <> "Orange" or qty <> 1
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement