I have a simple question. In SQL you can select.....where X in (a, b, c). With multiple parameters this is fine if you are selection exactly from your drop down what goes in the where in clause. In my case I have done this in selecting multiple record numbers and it works fine. When I set up the parameter to display one literal but then select with another I start having problems. For Example: I want to display "Divison Name" but actually select data by the Divison Number from the database. The Value Field is the DivisonNumber but the Label Field is the DivisionName. Since it is a multi-selection the DivsionName is displayed and I can check multiple DivisionNames but then the SQL gives me an error that says:
"Query Execution Failed for data set 'ReportRequestProd' line 21: Incorrect syntax near ','". It also displays the "DivisionName, DivisionName" in the drop down (not the DivisionNumber). Since I can't actually see the query I'm assuming that it is putting DivisionName in the query instead of the DivisionNumbers.
The WHERE clause has "DivisionID in (@DivisionParm)" which should resolve to "DivisonID in (10, 20)"
Anyone have any idea what I'm doing wrong? The report parameters for DivisionParm are
DataType: String
Prompt: Division
Multi-value - checked
Available values: From query-checked
Dataset: Divison
Value field: UniqueID (this is divisionnumber)
Labelfield: DivisionName
The division dataset is simple query for the divisonnumber (uniqueID) and divisionname:
Select * from tbl_Division
:D
Any help would be appreciated. I can't put it into production with this error still existing. BTW it works when I just display the DivisionNumbers to select from but the users would not know numbers.
Thanks,
Jim Reid
[email protected]