Solved

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

Posted on 2006-06-18
5
730 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now