SSRS SUM IIf来自今年,星期,一年,一年

时间:2016-04-27 16:09:30

标签: reporting-services ssrs-2008 ssrs-2012

我正在尝试计算TODAYWEEKYEAR已创建的事件TOTAL

我已经能够使用以下方式获得TOTAL:

=Count(Fields!Issue_ID.Value, "My_Data_Set") 

但是我没有成功获得有关创建了多少事件的总COUNT:TODAY,WEEK,YEAR对IncidentDateTime字段。

enter image description here

enter image description here

http://i.stack.imgur.com/LvTo1.jpg

http://i.stack.imgur.com/1jpas.jpg

1 个答案:

答案 0 :(得分:1)

使用这些表达式。

今天:

=SUM(IIF(Fields!IncidentDateTime.Value=Today.Date,1,0),"DataSetName")

年份:

=SUM(IIF(YEAR(Fields!IncidentDateTime.Value)=Today.Year,1,0),"DataSetName")

周:

=SUM(IIF(DATEPART(DateInterval.WeekOfYear,Fields!IncidentDateTime.Value)=
DATEPART(DateInterval.WeekOfYear,Today),1,0),"DataSetName")

月份:

=SUM(IIF(MONTH(Fields!IncidentDateTime.Value)=Today.Month,1,0),"DataSetName")

如果有帮助,请告诉我。