SSRS 2008 R2:在预期条件的上下文中指定的非布尔类型的表达式,靠近“,”

SSRS 2008 R2: An expression of non-boolean type specified in a context where a condition is expected, near ','

在我的 SSRS 2008 R2 报告中,我有一个多值 @Status 参数。这是数据集:

SELECT 1 AS ID, Description
FROM [ApplicationStatus]
WHERE StatusID IN (5, 6, 11, 14)
UNION
SELECT 2 AS ID, Description
FROM [ApplicationStatus]
WHERE StatusID IN (10)

在我的主要 ReportData 数据集中,我有以下过滤器:

WHERE ((@Status IN (1) AND a.StatusID IN (5, 6, 11, 14)) 
OR (@Status IN (2) AND a.StatusID IN (10)))

当 select将 1 和 2 作为 @Status 下拉列表中的值时,报告运行良好,但是当我 select 内置 '(Select All)' 选项,我收到以下错误消息:

Query execution failed for dataset 'ReportData'. An expression of non-boolean type specified in a context where a condition is expected, near ','.

多个值在@Status中,所以@status需要在IN之后,而不是之前。

WHERE (( 1 IN (@Status)  AND a.StatusID IN (5, 6, 11, 14)) 
OR (2 In (@Status) AND a.StatusID IN (10)))