Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  ian Jun 10 '13 at 14:14
add comment

1 Answer

up vote 5 down vote accepted

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 (_).

share|improve this answer
    
You are awesome! Thanks. For some reason I never knew you had to use an asterisk for personal geodatabases. –  ian 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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