October 10, 2014 at 3:02 pm
I'm not sure how to do this:
column1 column2
1 5
2 7
1 1
Total (I want the total of column2 where column1 = 1)
I'm sure there's a way to do it?
Anyone?
October 10, 2014 at 4:52 pm
SELECT column1, sum (column2)
FROM <yourtable>
WHERE column1=1
GROUP BY column1
-- Itzik Ben-Gan 2001
October 10, 2014 at 5:04 pm
For SSRS, it should be something like this:
=Sum(IIF(Fields!column1.Value = 1, column2, 0))
October 10, 2014 at 7:41 pm
Alan.B (10/10/2014)
SELECT column1, sum (column2)
FROM <yourtable>
WHERE column1=1
GROUP BY column1
How embarrassing, I did not realize, at the time I posted this, that this was an SSRS forum (smacking forehead).
-- Itzik Ben-Gan 2001
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply