Select to view content in your preferred language

The use of <> whilst setting up a definition query

3900
12
Jump to solution
07-16-2014 06:40 AM
PatrickMurphy1
Deactivated User

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
Deactivated User

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 Emeritus

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

0 Kudos
PatrickMurphy1
Deactivated User

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
Deactivated User

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
Deactivated User

Hi again Sol,

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

Paddy

0 Kudos
PatrickMurphy1
Deactivated User

=, 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
Deactivated User

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
Regular 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
Deactivated User

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 Emeritus

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