Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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 53
Multiple Parameters in Crystal 11 76
Crystal 11 Suppress main report section if subreport is blank 24 122
A string is required here error 20 19
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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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