简体   繁体   English

where 子句中的 SSRS 参数用法

[英]SSRS parameter usage in where clause

Hi I have one column HOLDJOB in SQL table.嗨,我在 SQL 表中有一列 HOLDJOB。 There are two values for this 1 or 0. I need to show in the SSRS report of onHold parameter is true then exclude the results with ONHOLD ='1' .这个 1 或 0 有两个值。我需要在ONHOLD ='1'参数的 SSRS 报告中显示为真,然后用ONHOLD ='1'排除结果。 If it is false.如果是假的。 then report should show all results with onhold 1 or 0然后报告应显示所有结果为 1 或 0

Thanks in advance提前致谢

I have put AND p6.HOLDJOB =@OnHold this filter in the query.我已经在查询中放置了AND p6.HOLDJOB =@OnHold这个过滤器。 And on the report I have defined parameter like IF Yes='0' .在报告中,我定义了参数,如IF Yes='0' This is working fine.这工作正常。 How can show all records when selection is No. I mean I have to exclude this condition如何显示选择时显示所有记录。我的意思是我必须排除这种情况

I'd format your WHERE clause with the following syntax.我会使用以下语法格式化您的WHERE子句。

SELECT 
    p6.* 
FROM 
    YourTable AS p6
WHERE
    1=1
    AND (@OnHold = 0 OR p6.HOLDJOB = @OnHold)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM