Reporting Services Expression

Last Post 19 Nov 2004 12:30 PM by cjseiler. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
cjseiler
New Member
New Member

--
17 Nov 2004 10:55 AM
I have a report that has 3 columns. The first 2 columns are named BaseHours and BaseTotalCost in a table called table1_CostCenter. The third column that I am attempting to create is a simple division of the two which works great. The problem I am running into is that sometimes the Cost (or both) can be zero. This causes an #Error to appear on the report. So I placed this code into the calculated field and it isn't reading it properly. The statement works when you switch it around and test for when there is a number in that column but not when it divides by zero. Any help would be great as I have scratched my head too long over this - I think fairly straightforward statement. Thanks!


=IIf(Sum(Fields!BaseTotalCost.Value, "table1_CostCenter")=0,"0",(Sum(Fields!BaseTotalCost.Value)/Sum(Fields!BaseHours.Value)))
cjseiler
New Member
New Member

--
19 Nov 2004 12:30 PM
I found the fix to my problem in case anyone else runs into a similar issue.

=IIf((ReportItems!BaseHours.Value = 0),"$0.00", ((ReportItems!BTCCalc.Value)/(ReportItems!BaseHours.Value*2085.7143)))0
You are not authorized to post a reply.

Acceptable Use Policy