SAP Knowledge Base Article - Public

1403545 - How to use a multi value parameter in SQL Command query

Symptom

  • How to use a multi value parameter in a sql command query

Reproducing the Issue

Following are the steps:

  • Choose to create a 'Balnk Report' in the CR 2008 developer application
  • Select the desired connection type,database and click on 'Add Command'
  • In the 'Add Command' dialogue box write the required sql query and choose to create a parameter from the 'Parameter List' pane.
  • There is "Allow multiple values" check box which needs to be checked to make the parameter accept multiple values
  • Use this parameter in the Where condition of the sql by refering it with an 'in' operator
  • For e.g:  Select * from Employee_Addresses where City in {?CityParameter}

    The issue is reproduced in the following environment:

    • Crystal Reports 2008 SP 1 and SP 2
    • Windows XP and Windows Server 2003 SP1

Cause

  • Users were unable to use multivalue parameter in the sql command query directly, until CR XI R2

Resolution

  • Crystal Reports 2008 introduces this feature by having a 'Allow multiple values' check box in the 'Command Parameter' dialogue box.
  • Users can create such a parameter in the 'Add command to Report' dialogue box and refer it using the 'in' operator in the sql query.

Keywords

  • CRYSTAL REPORTS 2008, MULTIVALUE PARAMETERS
, KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V1