SSRS如何计算多个条件?

SSRS how to count with multiple conditions?

我是 SSRS 表达式的新手,希望你能帮忙!

我需要创建以下内容:

"Count [issueID] where [closed] is not null and [due_date] is in the past."

我能做到第一点,但不知道在文本框表达式中添加“...and [due_date] is in the past”的语法。

干杯

林斯

将数据集源修改为 return 数据中的此标志会更容易。如果您不打算修改数据,那么我想您可以...

  1. 将计算字段添加到您的数据集 MyCalc。
  2. 设置计算字段的表达式

    =IIF(!IsNothing(字段!Closed.Value) && 字段!DueDate.Value < DateTime.Now,1,0)

  3. 现在您可以添加类似于

    的表达式

    =IIF(SUM(Fields!MyCal.Value) > 10 , "+10","not + 10")

你可以试试这个:

select 
count(case when [closed] is not null then [issueID] else 0 end) as 'TotalCount'
from [Your_Table]
where [due_date] <= getdate()