HOW TO

Escape wildcards when selecting by attributes

Last Published: April 25, 2020

Summary

Certain characters, such as an asterisk, may be reserved in SQL statements as wildcards, depending on the source data type. If a string contains that character, using it in Select by Attributes requires an escape character.

Procedure

Example of using escape characters to select records containing a character normally read as a wildcard:

  1. In the following selection of a personal geodatabase feature class, only "test*test" needs to be selected. However, all records are selected from the attribute table because of the wildcard character.
    [O-Image]

  2. To ignore the wildcards and only select records that contain "*", brackets have been inserted into the expression as MS Access escape characters:
    [O-Image]
    Note:
    In the file geodatabase, the "ESCAPE" keyword can be used to designate another character as the escape character. For for information, see the help link in Related Info.

Article ID:000011154

Software:
  • ArcMap

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options