all groups > sql server reporting services > september 2006 >
You're in the

sql server reporting services

group:

Multi-select Parameter - Single Quote Problem


Multi-select Parameter - Single Quote Problem sajjad.mussani NO[at]SPAM gmail.com
9/12/2006 1:34:03 PM
sql server reporting services:
Hi,

I am using SQL Server 2005 Reporting Services. I am trying to pass a
multi-select string value to my query but having difficulties with
single quotes. My query is:

SELECT * FROM Customers WHERE CustomerID > 200 AND CustomerType IN
(@CustomerType)

@CustomerType is a multi-select parameter in my report. The value of
this parameter should be passed as 'Commercial','Residential' BUT I
think it is being passed as 'Commercial, Residential'

Please help.
Thanks
Sajjad
Re: Multi-select Parameter - Single Quote Problem Bruce L-C [MVP]
9/12/2006 4:09:20 PM
Are you putting in the single quotes in your selection? You shouldn't.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Multi-select Parameter - Single Quote Problem sajjad
9/13/2006 7:33:59 AM
I am not putting single quote in my selection. My selection is done
using a Multi-select drop down box. What I was trying to say is that,
I think the parameter should be passed with single quotes around each
selection, but it is not.

Sajjad

[quoted text, click to view]
Re: Multi-select Parameter - Single Quote Problem Bruce L-C [MVP]
9/13/2006 4:16:41 PM
I don't think that is the issue. I do this all the time. Is your query in a
stored procedure?


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

RE: Multi-select Parameter - Single Quote Problem Radim Hampel
9/22/2006 7:02:02 AM
[quoted text, click to view]

From SQL perspective, this won't work. You cannot pass such parameter. You
must either use dynamic sql ('... cust in ''' + @cust ...) or parse this
multiparameter into table variable and use this table in subsequent query.

Radim Hampel

AddThis Social Bookmark Button