Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.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
Reporting services SSRS:要按日期部分筛选的表达式_Reporting Services - Fatal编程技术网

Reporting services SSRS:要按日期部分筛选的表达式

Reporting services SSRS:要按日期部分筛选的表达式,reporting-services,Reporting Services,我有一个数据集,其中包含给定时段的电话数据,我需要根据一天中的小时数过滤这些数据,以便我可以在显示高峰时段的图表中使用这些数据 到目前为止,我有一个表达: =Count(IIF(DatePart("h", Fields!CallStart.Value = 7), Fields!ID.Value, 0)) 所以,我希望这个表达式能够复制这个SQL查询: select * from PhoneData where MONTH(callstart) = 7 and YEAR(callstart) =

我有一个数据集,其中包含给定时段的电话数据,我需要根据一天中的小时数过滤这些数据,以便我可以在显示高峰时段的图表中使用这些数据

到目前为止,我有一个表达:

=Count(IIF(DatePart("h", Fields!CallStart.Value = 7), Fields!ID.Value, 0))
所以,我希望这个表达式能够复制这个SQL查询:

select * from PhoneData
where MONTH(callstart) = 7 and YEAR(callstart) = 2012 and DATEPART(HH, callstart) = 7
and Direction ='i' and Part1Device not like 'v%' and Continuation = '0'
在数据集查询中设置月份和年份


我只想说,这个表达式不起作用,我也不太明白为什么。。任何帮助都将不胜感激。

看起来DatePart函数的右括号位置不对。试试这个

=Sum(IIF(DatePart("h", Fields!CallStart.Value) = 7, 1, 0))

我以前试过这个,可惜不行。我应该只得到13行,但我得到了6000多行。@DeanMcGarrigle您是否将其与您试图复制的整个SQL查询进行比较?您只能将其与从PhoneData中选择*进行比较,其中月份(callstart)=7。在reporting services表达式中还有更多的where条件要写入。不,不是整个查询。上面的查询是我对数据集使用的,使用年和月的参数,因此数据已经被过滤。“这正是我需要的时间,因此有了这个表达。”DeanMcGarrigle我已经修改了我的答案。替换字段!ID.值为1,并更改为计数为总和。