0
with TotCFS as (select count(*)*1.0 as TotalCFS,
 'Total CFS' as RowTitle
from PrivilegeData.TABLENAMEC c
where cast(CallCreatedDateTime  as date) between @StartDate and @EndDate and CallPriority in ('1', '2', '3', '4', '5') and AreaCommand in ('FH', 'VA', 'NE', 'NW', 'SE', 'SW')  and IsBolo = 0
) 


select AreaCommand, CallPriority, 
avg(datediff(second, CallCreatedDateTime, CallEntryDateTime)) as AverageSeconds,
left(dbo.[ConvertTimeToHHMMSS](avg(datediff(second, CallCreatedDateTime, CallEntryDateTime)), 's'), 7) as DisplayAvg,
 'Create to Entry' as RowTitle, 1 as RowSort, b.SortOrder as ColumnSort
from PrivilegeData.TABLENAMEC c
inner join (select distinct AreaCommandAbbreviation, SortOrder from dimBeat) b on c.AreaCommand = b.AreaCommandAbbreviation
where cast(CallCreatedDateTime  as date) between @StartDate and @EndDate and CallPriority in ('1', '2', '3', '4', '5') and AreaCommand in ('FH', 'VA', 'NE', 'NW', 'SE', 'SW')  and IsBolo = 0
group by AreaCommand, CallPriority, SortOrder

UNION

select AreaCommand, CallPriority, 
avg(datediff(second, CallEntryDateTime, CallDispatchDateTime)) as AvgEntryToDispatchSeconds,
left(dbo.ConvertTimeToHHMMSS(avg(datediff(second, CallEntryDateTime, CallDispatchDateTime)), 's'), 7) as DisplayAvgEntryToDispatchSeconds,
 'Entry to Dispatch' as RowTitle, 2 , b.SortOrder
from PrivilegeData.TABLENAMEC c
inner join (select distinct AreaCommandAbbreviation, SortOrder from dimBeat) b on c.AreaCommand = b.AreaCommandAbbreviation
where cast(CallCreatedDateTime  as date) between @StartDate and @EndDate and CallPriority in ('1', '2', '3', '4', '5') and AreaCommand in ('FH', 'VA', 'NE', 'NW', 'SE', 'SW')  and IsBolo = 0
group by AreaCommand, CallPriority, SortOrder

我正在为这段代码做大约 8 个工会。区别在于行标题的名称。这份报告已经运行了大约一年,没有任何问题。我在 SSRS 查询类型文本中使用此代码。我还有一个行集名称“AverageSeconds”配置为读取此表达式

 =IIf((Fields!RowSort.Value) < 7,Format(DateAdd("s", Avg(Fields!AverageSeconds.Value), "00:00:00"), "H:mm:ss"), Sum(Fields!AverageSeconds.Value))

报告有些坏了,我已经尝试了所有我找到的方法来修复它。请帮助我解决此错误“rsErrorReadingNextDataRow”。

4

2 回答 2

0

这一定是正在操作的数据的问题。可能是 0 或 NULL 值条件。我将首先查看在问题开始时添加或更改的记录。

于 2019-12-13T17:53:54.003 回答
0

我删除并重新创建了事实表并运行了我的 ssis 包,它可以修复它。我这样做的原因是因为我找不到 NULL 或 0 值。

于 2020-01-10T22:07:41.717 回答