SAP Knowledge Base Article - Public

1998518 - Add Command is causing error with a SQL State of 42000 (Vendor Code: 156)

Symptom

  • Setting a VarChar Variable with a String Parameter in a Crystal Report 2008 SP6.3
  • Add Command is causing error with a SQL State of 42000 (Vendor Code: 156):

 

Untitled.png

Environment

  • Crystal Reports 2008

Cause

  • The parameter was of type string.
  • However, in part, the executed SQL was:

 

SET @BeginDate ={?BeginDate}

Resolution

  • Rather than using SET @BeginDate ={?BeginDate} use:

 

SET @BeginDate ='{?BeginDate}'

 

Keywords

CR param eror 12 date varchar var char date time datetime , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011, feature pack 03 ; SAP Crystal Reports 2013