ERROR

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.

Cause

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:

    Code:
    "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:

    Code:
    "http://support.esri.com/search/KbDocument.asp?dbid=20857".Quote.Unquote

    returns this value:

    http://support.esri.com/search/KbDocument.asp?dbid=20857: 

Article ID:000004617

Software:
  • 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