The use of <> whilst setting up a definition query

3020
12
Jump to solution
07-16-2014 06:40 AM
PatrickMurphy1
New Contributor III

Over the last couple of years I've been using the <> in query builder to exclude out certain categories, unfortunately this year it doesn't seem to be working anymore.

I am using the same data, the same version of ArcMap (10.0 Service Pack 5).

Would be any obvious reason for this

Paddy 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
PatrickMurphy1
New Contributor III

Hi to All

It has finally worked out for me

I just replaced the "OR" with "AND" and it worked

Thanks all

Appreciate it

Regards

Paddy

View solution in original post

0 Kudos
12 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Not sure.... often != is used to represent not equal to

0 Kudos
PatrickMurphy1
New Contributor III

Hi Dan

I tried that and it didn't work, when i verify its telling me "The expression was successfully verified"

Thanks anyway

Paddy

0 Kudos
PatrickMurphy1
New Contributor III

Hi Sol

The data is from an SDE server. It is a String field, Unfortunately I don't have access to the SQL databse.

Cheers

Paddy

0 Kudos
PatrickMurphy1
New Contributor III

Hi again Sol,

I tried that and the same result, All records were selected

Paddy

0 Kudos
PatrickMurphy1
New Contributor III

=, came up with an error when I verified it.

I'm using the options from "Get unique Values" so case sensitivity doesn't apply.

It might be a matter of doing the Query the long way

Thanks

Paddy

0 Kudos
PatrickMurphy1
New Contributor III

This is how my query is set up, the intention of this is to show all categories except "Complete" and "Expired"

Also this is the Error I received when using the =,

0 Kudos
RyanStovern__GISP
Occasional Contributor

Change your "Or" to an "And" and see what happens. This should give what you want. By using "And" you are telling the query you want all attributes that are not Complete or Expired.By saying "Or" it is confused on which ones to exclude.

0 Kudos
ScottDean
New Contributor II

Make sure it is setup like the following.

[field name]  + operator + value and [field name]  + operator + value

Example

STATUS <> 'COMPLETED' AND STATUS <> 'EXPIRED'

Obviously I do not know what your field is called so that needs to be changed in the example.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

try putting either side of your OR or AND expression in round brackets ie ( )  Also, I assume that you are selecting rather than typing while you build the expression

0 Kudos