Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql SSRS Countrows IF表达式中的多个条件_Sql_Reporting Services_Expression_Reportbuilder3.0 - Fatal编程技术网

Sql SSRS Countrows IF表达式中的多个条件

Sql SSRS Countrows IF表达式中的多个条件,sql,reporting-services,expression,reportbuilder3.0,Sql,Reporting Services,Expression,Reportbuilder3.0,在ReportBuilder3.0中,我很难将两个条件放入countrows表达式中,我确信这是非常简单或不可能的,但我就是做不到!我只想在一个表达式中返回满足以下两个条件的值 =总和(IIF(字段!COL1.Value=“X”,1,0)) 及 =Sum(IIF(Fields!COL2.Value=“Y”,1,0))只需将它们合并为一个IIF: Sum(IIF(Fields!COL1.Value = "X" and Fields!COL2.Value = "Y", 1, 0)) 对不起,我应

在ReportBuilder3.0中,我很难将两个条件放入countrows表达式中,我确信这是非常简单或不可能的,但我就是做不到!我只想在一个表达式中返回满足以下两个条件的值

=总和(IIF(字段!COL1.Value=“X”,1,0)) 及
=Sum(IIF(Fields!COL2.Value=“Y”,1,0))

只需将它们合并为一个
IIF

Sum(IIF(Fields!COL1.Value = "X" and Fields!COL2.Value = "Y", 1, 0)) 

对不起,我应该放countrows而不是SUM,当我放countrows时它不起作用,当我使用SUM时它返回0,我知道SUM不是答案。这个SUM的逻辑是正确的!我对ssrs语法了解不多,所以这里可能有其他错误,但这应该与countrows相同。可能是一个单引号
用于字符串比较,而不是两个<代码>“啊,它是一个‘或’而不是一个‘和’,否则它会自动取消。