SAP Knowledge Base Article - Public

1498799 - SQL Syntax Error in Crystal Reports Command Object After adding a parameter

Symptom

Crystal Reports Command Object works fine until adding a new string parameter

Reproducing the Issue

  • As an Example
    • Sql is Select * From Customer
    • Add string parameter {?PARAM1} to command object
    • Add where CustomerName = {?PARAM1} to the end of sql statement so it is now Select * From Customer where CustomerName = {?PARAM1}
    • Click ok, receive error

Cause

  • {?PARAM1} changes to text that is entered by the user at run time
  • SQL statement requires single quote marks around text

Resolution

  • Add the single quotes
  • Select * From Customer where CustomerName = '{?PARAM1}'

Keywords

invalid , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports XI