all groups > sql server reporting services > august 2007 >
You're in the

sql server reporting services

group:

Expression Question


Expression Question Ryan Mcbee
8/28/2007 12:24:01 PM
sql server reporting services: I am working on an aging report and am trying to sum one of the columns that
is the 30-60 Day bucket. I have the expression written as the following;

"=sum(fields!extcost.value) where (fields!interval.value>30 and
Fields!Interval.Value<=60)"

What logic should I be using?

Thank you,

Ryan

RE: Expression Question Michael C
8/28/2007 1:16:05 PM

2 ways to deal with this. In report cell:

=Sum(IIf(Fields!Interval.Value=>30 AND
Fields!Interval.value<=60,Fields!extcost.value,0))

However, I normally try to do this in the SQL with a CASE statement for each
bucket.

SELECT X,Y,Z,Sum(CASE WHEN Interval BETWEEN 30 and 60 THEN extcost ELSE 0
END As Bucket2,A,B,C...
FROM.....

Michael C

[quoted text, click to view]
AddThis Social Bookmark Button