4

I have been trying to create a Definition query to symbolize a set of water features. I cannot edit the .shp file and I want to exclude a multiple values. I have tried using NOT but have had no luck.

This is what works for one value:

NOT "OGF_ID" = 214620160

I don't know how to add more values to exclude.

What am I missing?

10

The IN operator is what you're looking for. Use a comma-separated list in parentheses, like so:

"OGF_ID" NOT IN (214620160, 214620161, 214620162)
  • I noticed differences between using "not in" "is not" and "<>" when trying to exclude certain field values. Anyone have some advice on when to use which, as I am not having success with any combination. Sometimes all features disappear, sometimes subsets which don't apply to the DQ, overall it seems very inconsistent. – user25644 Jul 31 '15 at 21:37
  • @user25644 if you post a separate question, a lot more people will see it and be able to help you. In general, "not in" is used for a list of possible values surrounded by parentheses, while "<>" (i.e. "not equal to") is used to compare against a single value. – nmpeterson Jul 31 '15 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.