Select to view content in your preferred language

ArcPro 3.0 Definition Query

703
5
10-25-2022 12:09 PM
Labels (1)
MichaelMcBain
Emerging Contributor

Is there a definition query bug in ArcPro 3.0?

 

I'm filtering out certain parking lots by location type or by public access in the same query, but the OR condition isn't removing the correct features. So this query removes zero features:

LOCDESC <> 'Street' OR Access <> 'Private'

While this one removes the ones I want:

LOCDESC <> 'Street' And Access <> 'Private'

0 Kudos
5 Replies
AngelaSchirck
Frequent Contributor

So, help me understand what you want to filter here.  Are you trying to filter out when either of the two statements are true? e.g. if LOCDESC <> "Street" but Access = "Private"  should be filtered also? 

0 Kudos
RhettZufelt
MVP Notable Contributor

Remember, the definition query doesn't 'filter out' features that return true, it shows them and filters everything else.

While this one removes the ones I want:

LOCDESC <> 'Street' And Access <> 'Private'


I'd use that one 🙂
R_

MichaelMcBain
Emerging Contributor

Since I want parking areas that are not Street or areas that are not "Private" should it be an OR, not and?

 

I am using the one that gets the job done

RhettZufelt
MVP Notable Contributor

OR will draw all features that are not private, regardless of what the LOCDESC value is, as well as drawing all the features that are not street, regardless of what the Access value is.

R_

0 Kudos
BarryNorthey
Frequent Contributor

In SQL And and Or are somewhat the reverse of how we use them in English. In English we might say that we want to display (Definition Query) or select (Select By Attributes) only the Pine (P) and Spruce (Sw) stands in this layer (field SP1). IN SQL we would write: SP1 = 'P' Or SP1 = 'Sw' wherein a selection is made when a condition on either side of the Or is met. 

If we wrote SP1 = 'P' And SP1 = 'Sw' (as it sounds in English) no selections can be made because both conditions must be met to make a selection and in this example, a tree can't be both a spruce and a pine .