I'm running ArcMap 10.1.

I have a point feature class joined to a table and am trying to query a field.

If I do [field] = 'TEST', it selects all the fields.

But if I do [field] LIKE 'TES%', it doesn't work.

Any idea why the LIKE command isn't working?

  • Double quotes are for field names and single quotes are for field values, as far as I know. Maybe that's the issue? – Martin Jun 10 '13 at 14:06
  • Sorry, it is only single quotes. – ianbroad Jun 10 '13 at 14:14

The wildcard to use with LIKE depends on the data source.

You are using square brackets as field name delimiters. So I suppose you are using a Personal Geodatabase.

The wildcards you have to use to query a personal geodatabases are asterisk (*) for any number of characters and question mark (?) for one character.

If you use SDE or file based geodatabase you have to use percent symbol (%) and underscore (_).

  • You are awesome! Thanks. For some reason I never knew you had to use an asterisk for personal geodatabases. – ianbroad Jun 10 '13 at 14:27
  • 2
    With a personal geodatabase you have to use the same syntax as Microsoft Access (* and ?). – Jens Jun 10 '13 at 14:29
  • 1
    here's a little tip - on the Select By Attributes dialog, at the lower left, there is a button which changes to show the relevant wildcard character for each dataset. It shows * or % depending on the chosen layer type. – Stephen Lead Jun 11 '13 at 8:41

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.