Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Reporting Services Development
 SSRS - IIF Expression for Avg Calculation
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

United Kingdom
4 Posts

Posted - 02/13/2014 :  10:48:06  Show Profile  Reply with Quote

I am working on an SSRS report and would like to create 2 separate average calculations at the bottom.

Basically I have a column that will either have the data "LH" or "FH" for the column "Tenure". I am working out days between an opening date and then completion date and have a column that displays this called "Days_to_Complete. I would like to work out the average amount of days for the "LH" tenure records, "FH" tenure records and then the total for both. I have done the easy one of them both first using:


But i am stuck on how to do it based on whether the tenure is "LH" or "FH". So far I have the below which I know is not complete:

=IIF((Fields!Tenure = "LH", Avg(Fields!Days_to_Complete.Value))

I get the error:
[rsCompilerErrorInExpression] The Value expression for the textrun ‘Client1.Paragraphs[0].TextRuns[0]’ contains an error: [BC30311] Value of type 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot be converted to 'String'.

Can anyone help me or point me in the right direction here?


  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000