0

I am basically trying to do what is asked in this question:

Passing multiple values for a single parameter in Reporting Services

but it is not working for me.

My parameter has a data type of text. I have a feeling that my parameter is being surrounded by quotes when it is inserted into my query.

Query

SELECT 
    AllUserData.tp_ID, Title as TestSite, tp_Title as TestCase, nvarchar6 as ItemNumber, 
    nvarchar7 as DefectType, nvarchar8 as Status, nvarchar9 as QuestionID, 
    ntext2 as Question, AllUserData.tp_Version as Version, 
    CONVERT(VARCHAR(10), AllUserData.tp_Modified, 111) AS DateModified
FROM 
    [dbTOG].[dbo].[AllUserData] 
INNER JOIN
    dbTOG.dbo.AllLists on dbTOG.dbo.AllUserData.tp_ListId = dbTOG.dbo.AllLists.tp_ID 
INNER JOIN
    dbTOG.dbo.Webs on dbTOG.dbo.AllLists.tp_WebId = dbTOG.dbo.Webs.Id
WHERE 
    (nvarchar8 = 'PASS' OR
     nvarchar8 = 'FAIL' OR
     nvarchar8 = 'N/A' OR
     nvarchar8 = 'TBD' OR
     nvarchar8 = 'TBRT' OR
     nvarchar8 = 'FIXED') 
    AND Title = @TestSite 
    AND tp_Title IN (@TestCase)

Parameter expression for @TestCase

=Join(Parameters!TestCase.Value, ",")
Community
  • 1
  • 1
Mikey G
  • 3,473
  • 1
  • 22
  • 27

1 Answers1

5

This is quite late but I was struggling with pretty much the same thing. Eventually I found the answer from the link in the OT, however not the accepted one.

I changed the parameter expression to:

=SPLIT(JOIN(Parameters!<your param name>.Value,","),",")

This worked perfectly for me.

nicV
  • 650
  • 7
  • 16
  • 1
    right click in dataset > "Dataset Properties" > "Parameters" tab > click in buttom "Fx" in the parameter – ch2o May 25 '15 at 19:34
  • I'm on a different project now so no longer have access to this, I don't understand your comment, what are you trying to say? – nicV May 26 '15 at 09:44
  • I'm just trying to explain where to put the formula for multiple values in parameters – ch2o May 27 '15 at 17:38