报告服务抛出错误 [英] Reporting services throwing error

查看:98
本文介绍了报告服务抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我正在更新报告服务中的报告,但在将新的参数传递给已经存在该sql的sql时遇到了麻烦:

Hey guys, I am updating a report in reporting services and I''m having trouble passing a new paramater in to the sql thats already there the sql:

Declare @SQL nvarchar(4000)

Set @SQL = '
Select Left(' +Case @LookupNumber When 0 Then 'A' When 1 Then 'B' When 2 Then 'C' End + 'Number,' +Cast(@Length as varchar(2)) +') StartofNumber, 
	Count(*) TotalCalls, Sum(Case Duration When 0 then 0 Else 1 End) TotalConnectedCalls, 
	Sum(Duration)/60 Minutes
From vwCDRSuspense200601 With (Nolock)
Where Carrierid = @CarrierId and Productid = @ProductId and errornumber = 2020 And Group by Left(' +Case @LookupNumber When 0 Then 'A' When 1 Then 'B' When 2 Then 'C' End + 'Number,' +Cast(@Length as varchar(2)) +')
Order By StartofNumber'

exec sp_executesql @SQL,N'@ProductId smallint, @CarrierId smallint', @ProductId, @CarrierId


当我尝试在where子句And Duration = @Duration中添加任何新的参数时,报告将中断.漫长的一天非常感谢您的帮助:),
干杯


When I try to add any new paramater say in the where clause And Duration = @Duration the report breaks. Any help is very much apreciated as its been a long day:),
Cheers

推荐答案

Where子句需要其他条件...但是请参见" Group By子句
Where clause expects for another condition... but "see" Group By clause
Where Carrierid = @CarrierId and Productid = @ProductId and errornumber = 2020 And Group by Left


删除And单词,一切都应该正常.


Remove And word and everything should be OK.


这篇关于报告服务抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆