Solved

How do I pass multiple values for a parameter to a database command

Posted on 2006-06-18
5
764 Views
Last Modified: 2007-12-19
Hello,

I have a report that I prompt the user for several paramaters.  One of the parameters is the state code.  The user can select one or more or the 12 states for which they can run this report.  The parameter is then passed to the database command parameter.  The only problem is the command only works when I select 1 state code.  If I select more than one state code the query returns nothing to the report.  How do I change my SQL to accept more than one parameter.  
Also, "allow multiple values" equals TRUE.

WHERE   B.RMSBRGLVL4 IN ('CG9A','C77F')    
AND     C.RECORDTYPE = 'D'
AND     C.RMSSTATECD IN ('{?StateCode}')     <---- I need to be able to pass a list of values i.e. ('CA','CO','FL',GA')
AND     B.RMSDTCHGDT <> 0
AND     DATE(TIMESTAMP(B.RMSDTCHGDT||'000000')) BETWEEN {?StartDate} AND {?EndDate}
0
Comment
Question by:BrianMack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 16931314
First don't use '  ' around the parameter name

          C.RMSSTATECD IN ({?StateCode})

How are you calling the report?
I believe ther eis an example in here
http://support.businessobjects.com/communityCS/FilesAndUpdates/rdc10_samples.exe.asp

mlmcc

0
 

Author Comment

by:BrianMack
ID: 16931386
Hi Michael,

I originally tried to make the In statement work without the quotes and I got the following error:  Failed to retrive data from database. Details: 42S22:[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0206 - Columns GA not in specified tables. [Database Vendor Code: -206].

I'm running the report in Crystal Reports XI report designed.  WShen I get it tweaked right I'll publish it to Buisness Object XI so the user can access it.
0
 

Accepted Solution

by:
BrianMack earned 0 total points
ID: 16935109
The official word from Business Objects technical support.


Question : How to pass the input of a multiple values parameter to a command object parameter ?

Solution :

When creating a report based on a command object, it is not possible to create a multiple values parameter for the command because SQL only support dicrete value parameter.

To workaround this situation, you can create a report based on a table that return one record. Then, create in Crystal Reports a multiple values parameter. After, convert the values entered in the parameter into a string, and finally pass the string value to a subreport discrete value parameter that is based on your command object.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 16938880
Question closed and points refunded

mlmcc
Crystal Reports Page Editor
0
 

Author Comment

by:BrianMack
ID: 16938883
THANKS.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question