Running ArcPro 2.8.1
I'm trying to run SQL queries on text field of a hosted feature layer but am given "There was an error in the expression." when making a definition query and "ERROR 000358: Invalid expression" when using the 'select by attributes' tool. Same result regardless of whether I'm using the query builder or writing the SQL query directly. I've tried simplifying to something as simple as "Field IS NOT NULL" to test but no luck.
What's really strange to me is that I can run queries on every other field in this feature layer.
Any ideas?
What kind of field is it? And what is the field name? It's possible to have a reserved SQL keyword as a field name, perhaps that's throwing things off.
Field name: Grant
Data type: Text
Ah! "Grant" is definitely a reserved SQL keyword, and I would guess that it's causing the expression to fail. Can you try enclosing the field name in double quotes? "Grant"
Ah, shucks. I didn't think it was, but clearly it is. Thanks for that. The double quotes don't seem to be working, unfortunately. Thankfully in this case it's not a big deal. I'll come up with another work-around.
Appreciate your assistance, Josh.