question

tabularyee avatar image
tabularyee asked

Custom Code in SSRS for summing counts

This is a bit long winded, but I hopeyou get the gist of it Basically I'm trying to find the potential of workers by saying that if the day is a working day, then the worker can work 8 hours. I have to do a sum on the following exprssion
=((COUNT(Fields!date.Value) - 
(COUNT(iif(Fields!Day_Type.Value = "Weekend", Fields!Day_Type.Value,
iif(Fields!Description.Value =Nothing, Nothing,Fields!Description.Value))))) * 8))
Obviously, I can't use runing aggregation, so I read that I can use custom code for this task, using this to get the total, which is
Public Function AddTotal(ByVal potential AS integer) AS integer
	Dim totalPotential As integer
        totalPotential = (totalPotential + potential) 
        return totalPotential
End Function
I then put the expression as in the argument for the addTotal function. Problem is I am getting the figure I would get if I just put the above expression in there. does anybody know why this is?
sql-server-2005ssrs
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.