SAP Knowledge Base Article - Public

2545058 - Using "IN" operator with Crystal Reports parameters in Records Selection formula


  • what is the proper syntax for the "IN" operator with parameters
  • "IN" operator does not return expected values


  • Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. Create a report of Xtreme Sample Database and "Customer" table
  2. Add a single value string parameter
  3. Add records selection formula:  {Customer.Contact First Name} IN {?My Parameter}
  4. Refresh the report and enter "Alexander" for the parameter
  5. It brings records with the following values for the First Name: "Alex", "Alexa" and "Alexander"   


  •  The formula works as expected. Formula scans the parameter string for the match and returns TRUE even if the field just a part of the parameter string.


  • If 100% match is required then use one of the following syntax for records selection formula:
    1. {Customer.Contact First Name} = {?My Parameter}
    2. {Customer.Contact First Name} IN [{?My Parameter}]

Note: Square barckets makes the parameter as a part of an Array, so it compares the field to a member of Array.


See Also

  •  Click Help menu in Crystal Reports and search for "IN ARRAY" and "ARRAY DATA TYPES" articles


IN, LIKE, function, wrong results , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To


SAP Crystal Reports 2016