How To: Escape wildcards when selecting by attributes
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.
Example of using escape characters to select records containing a character normally read as a wildcard:
- 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.
- To ignore the wildcards and only select records that contain "*", brackets have been inserted into the expression as MS Access escape characters:
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.