简体   繁体   English

将SQL Server 2008 R2报表部署到SQL Server 2008时出错,聚合函数不能嵌套在其他聚合函数中

[英]Error on Deployment of SQL server 2008 R2 reports to SQL Server 2008, Aggregate functions cannot be nested inside other aggregate functions

I have used SQL Server 2008 R2 for developing my reports, and when I tried to deploy it on hosting server which is SQL server 2008 it displayed an error while deploying a report, 我已经使用SQL Server 2008 R2来开发报告,当我尝试将其部署在SQL Server 2008的托管服务器上时,它在部署报告时显示错误,

Error 错误

The Value expression for the textrun 'Textbox36.Paragraphs[0].TextRuns[0]' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). textrun'Textbox36.Paragraphs [0] .TextRuns [0]'的Value表达式在另一个聚合函数(或RunningValue)的参数中包含一个聚合函数(或RunningValue或RowNumber函数)。 Aggregate functions cannot be nested inside other aggregate functions. 聚合函数不能嵌套在其他聚合函数中。

I think following expression is throwing error while deploying from sql server 2008R2 to sql server 2008 我认为以下表达式在从sql server 2008R2部署到sql server 2008时引发错误

Expression 表达

=Sum(IIF(Fields!RegisteredOn.Value  >Parameters!FromDate.Value and  Fields!RegisteredOn.Value  < Parameters!EndDate.Value , 1,0))

Is there any workaround for this in SQL server 2008 SQL Server 2008中对此是否有任何解决方法

You could try replacing the IIF with CASE. 您可以尝试用CASE替换IIF。 I am not sure that IIF is available in all versions of SQL Server. 我不确定IIF是否在所有版本的SQL Server中都可用。

http://msdn.microsoft.com/en-us/library/ms181765.aspx --See C. Using CASE to replace the IIf function that is used in Microsoft Access -- http://msdn.microsoft.com/zh-cn/library/ms181765.aspx-请参阅C。使用CASE替换Microsoft Access中使用的IIf函数-

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM