definition query

1491
5
Jump to solution
07-12-2016 01:17 PM
Highlighted
New Contributor II

I'm wondering what definition query to use to not display features in a field. For example, field is "Name", data is PETROLEUM WELL NO 1 TH and I do not want features with TH in them displayed.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Honored Contributor

Ignores 'TH' anywhere': "Name" Not Like '%TH%'

Ignores 'TH' only at the end: "Name" Not Like '%TH'

Ignores 'TH' preceded by a space: "Name" Not Like '% TH%'

etc.

Building a query expression—Help | ArcGIS for Desktop

View solution in original post

5 Replies
Highlighted
MVP Honored Contributor

Ignores 'TH' anywhere': "Name" Not Like '%TH%'

Ignores 'TH' only at the end: "Name" Not Like '%TH'

Ignores 'TH' preceded by a space: "Name" Not Like '% TH%'

etc.

Building a query expression—Help | ArcGIS for Desktop

View solution in original post

Highlighted
New Contributor II

excellent, thank you very much...have a great day!

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Building a query expression—Help | ArcGIS for Desktop

NOT  YourField LIKE '%TH'

with the appropriate field designators depending on the source table (and I am not sure if NOT has to be outside the field or you can use NOT LIKE... not near Arc* now) But the key is to use a wildcard and TH the example shown is if the field always ends in TH use %TH otherwise %TH% but that will find a whole bunch of others I suspect. So once you have selected those, then NOT switches the selection leaving those behind

EDIT Too slow... never get a coffee mid answer

Highlighted
New Contributor II

in my case the TH can appear anywhere, and the data is different lengths...looks like I have success with    "Name" NOT LIKE '% TH %'

Reply
0 Kudos
Highlighted
MVP Honored Contributor

Of course, that definition query ('% TH %') will not match your original example ('PETROLEUM WELL NO 1 TH'), which does not end in a space.

Reply
0 Kudos