Groups | Blog | Home
all groups > sql server reporting services > july 2004 >

sql server reporting services : using the IN clause


Marc Miller
7/2/2004 4:29:14 PM
How do you parameterize an IN clause?

I tried it and it keeps putting quotes around the param and
then the param does not show in the Report Parameters dialog.

This is what I get:

Select *
from SomeTable
where product IN ('@products')

TIA,
Marc Miller

Jay Nathan
7/2/2004 4:47:18 PM
Marc: Multi-value parameters are not supported in v1 or SP1 of Reporting
Services. Here's a link to another post in this newsgroup on the same
subject. Looke for how Jeremy Pettit solved the problem. May work for you,
too.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=ONnNRtsBEHA.3064%40tk2msftngp13.phx.gbl&rnum=2&prev=/groups%3Fq%3D%2522in%2Bclause%2522%2Bgroup:microsoft.public.sqlserver.reportingsvcs%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3DONnNRtsBEHA.3064%2540tk2msftngp13.phx.gbl%26rnum%3D2

--
Jay Nathan
MARINER
http://www.mariner-usa.com

http://www.jaynathan.com/blog

[quoted text, click to view]

Olaf Pietsch
7/2/2004 10:57:13 PM
In uMtzENHYEHA.3536@TK2MSFTNGP11.phx.gbl, Marc Miller typed:
[quoted text, click to view]
a suggestion to solve this, you could use an UDF like this:

Select * from SomeTable
where product IN (select value from dbo.fn_split (@products, ',') )

You can find the UDF dbo.fn_split() here:
http://www.winnetmag.com/SQLServer/Article/ArticleID/21071/21071.html
or
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=21071.

Olaf

Marc Miller
7/7/2004 8:14:14 AM
Thank you for your answers. Both solutions worked for me. I hope that MSFT
will address this
in the next version of Reporting Services if they feel that this will be a
1st class product.

Marc Miller
Applications Developer
Commonwealth Telephone Enterprises
Wilkes Barre, PA

AddThis Social Bookmark Button