definition query

2052
5
Jump to solution
07-12-2016 01:17 PM
TerryWatson
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.

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
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
DarrenWiens2
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

TerryWatson
New Contributor II

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

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

TerryWatson
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 %'

0 Kudos
DarrenWiens2
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.

0 Kudos