Syntax Error

Last Published: April 25, 2020

Error Message

A syntax error occurs when trying to use a question mark or an asterisk as a character in a string field in the Field Calculator, SQL connections, and Query Builder.


The Field Calculator, SQL connections, and Query Builder interpret these characters as wild cards, not as string characters.

Solution or Workaround

  • Use the request .AsChar to concatenate the wild card character into the string using the appropriate ASCII code number. The ASCII value for a question mark is 63, and a for an asterisk is 42. The following expression returns the value string*string:

    "string" + 42.AsChar + "string"

  • Use the .Quote and .Unquote requests to populate a field. This makes the whole string readable. For example, the following expression in the Field Calculator:


    returns this value: 

Article ID:000004617

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic