Groups | Blog | Home
all groups > sql server reporting services > september 2005 >

sql server reporting services : Sum with a calculation inside.


johnmarc NO[at]SPAM gmail.com
9/30/2005 9:22:00 AM
I have a relatively complex report (2 different grouping levels) and
I'm trying to get a specific sum and I'm having some problems.

I have 3 columns that are involved in the sum. PW, ceded_PW and
isInternal

The sum I want is sum(PW) - sum(ceded_pw * -1 * (isInternal - 1))
I have also tried this like this:
sum(PW - (ceded_pw * -1 * (isInternal - 1)))

isInternal is a flag that is either 0 or 1 I'm subtracting 1 so that
the multiplication will zero out any internal numbers, and only
subtract the external numbers from the table.

In my experimentation I added the PW - (ceded_pw * -1 * (isInternal -
1)) as it's own column to the stored procedure and then summed that
field and the result was correct, so I believe that scoping is not what
is causing the problem.

Any suggestions would be appreciated.
F. Dwarf
10/3/2005 8:52:04 AM
Can you write the error message you recieve?
Make sure that the isInternal field is an integer like type. If isInternal
AddThis Social Bookmark Button