Is it possible to do 'OR' in the WHERE clause off the Query method of a map service. We are running into errors when providing SQL like this :
WHERE
(
OBJECTID IS NOT NULL
AND OBJECTID LIKE '%fdas%'
)
OR (
ID IS NOT NULL
AND ID LIKE '%fdas%'
)
OR (
Label IS NOT NULL
AND Label LIKE '%fdas%'
)
This seems to be legal SQL, and the documentation says any legal SQL would work, so I'm a bit confused as to why this isn't working. It works if we do one field at a time, but it's leading to a massive amount of HTTP calls.
Adam,
The fact that you have OBJECTID LIKE '%fdas%' seems off. OBJECTID is normally a numberic field and you are attempting to do a like query for a string.
I can get a where like this to run, without issue:
query.where = "(STATE_NAME IS NOT NULL AND STATE_NAME LIKE '%fdas%') OR (STATE_ABBR IS NOT NULL AND STATE_ABBR LIKE '%fdas%')"