Select by Attributes: AND...AND

346
2
Jump to solution
09-30-2022 05:44 AM
Labels (1)
M_ST
by
New Contributor

Hi, I would like to run a query that includes multiple codes of a field, like Selection: Where clc_18 is equal to (Number) AND clc_18 is equal to (Number) ....But no results were found. What did I do wrong?

0 Kudos
1 Solution

Accepted Solutions
Luke_Pinner
MVP Regular Contributor

Your query is requesting rows where each entry in the clc_18 field is both one value and a different value at the same time.  That will always return no rows.

Use OR instead of AND, e.g clc_18 = Number OR clc_18 = Another Number

Or use the IN operator, e.g clc_18 IN (Number, Another Number, Some Other Number)

 

 

View solution in original post

2 Replies
Luke_Pinner
MVP Regular Contributor

Your query is requesting rows where each entry in the clc_18 field is both one value and a different value at the same time.  That will always return no rows.

Use OR instead of AND, e.g clc_18 = Number OR clc_18 = Another Number

Or use the IN operator, e.g clc_18 IN (Number, Another Number, Some Other Number)

 

 

M_ST
by
New Contributor

Thanks! It works without problems. 😁✌️

0 Kudos