HOW TO

Escape wildcards when selecting by attributes

Last Published: October 1, 2025

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

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options