I am trying to query records that contain a specific string within a longer string of an attribute table but it is not working. There are a few extra details to the situation.

  • DQ is going onto a polygon layer "Parcels"
  • "Parcels" is joined to a non-spatial table coming out of an Access DB (MDB)
  • DQ is applied to values within the joined MDB fields

Syntax for DQ is:

Roll Detail Extract_1.FIX-LGL LIKE '%Section 80%'

The hope is that the DQ will leave only polygons where the term "Section 80" is in the value for the field FIX-LGL.

I have tested the query on an un-joined version of the "Parcels" layer, using an already existing field on a value I know to exist, and it worked. I also tested the query on a joined version of "Parcels" on the same existing field and it still worked, but when i switch the query syntax to the joined attribute and different value, it finds no records.

Is there something with the join table name or field name that is confusing arcmap, ie. spaces in file name or the "-" in the field name?

  • 2
    Is "DQ" your abbreviation for Definition Query or something else? Please do not use all but the most common abbreviations within your questions so that they are accessible to as many GIS SE users as possible. – PolyGeo Dec 8 '17 at 0:10
  • What happens when you verify the definition query? Does it say there is a syntax error? Or does it say that the syntax is correct but there are no records? – Dan_h_b Dec 8 '17 at 11:41
  • Yes, "DQ" is my abbreviation for Definition Query, sorry if this is uncommon, everyone at my GIS workplace uses it often, so I thought it was a fairly common abbreviation. – user25644 Dec 11 '17 at 20:56
  • I tried building the query using Query Builder on a different ArcMap install (10.3), and it inserted quotation marks where the other install's Query Builder had not (10.2), making the query "Roll Detail Extract_1.FIX-LGL" LIKE '%Section 80%' and it works. No idea if it's an ArcMap version thing, but apparently the quotes were the answer. – user25644 Dec 11 '17 at 21:51

The initial query was built using Query Builder in 10.2 and it built the query without quotation marks around the field name. I built the same query in a 10.3 install also using Query Builder and this time it inserted quotation marks around the field name being queried, which seems to have done the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.