Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Selection formula 7 49
Crystal Reports Sub Report 4 78
Pagination Difference  in crystal report 7 42
Crystal Reports No Record Returned 2 37
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. …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

10 Experts available now in Live!

Get 1:1 Help Now