0

我基本上是在尝试做这个问题中提出的问题:

在 Reporting Services 中为单个参数传递多个值

但这对我不起作用。

我的参数的数据类型为text. 我有一种感觉,当我的参数被插入到我的查询中时,它被引号包围了。

询问

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)

@TestCase 的参数表达式

=Join(Parameters!TestCase.Value, ",")
4

1 回答 1

5

这已经很晚了,但我正在为几乎同样的事情而苦苦挣扎。最终我从 OT 的链接中找到了答案,但不是被接受的。

我将参数表达式更改为:

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

这对我来说非常有效。

于 2013-08-13T11:23:07.727 回答