Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSRS counting column total based on conditional boolean

Status
Not open for further replies.

mjd3000

Programmer
Apr 11, 2009
136
GB
Hi,

I have a column like this :

BooleanColumn:
Yes
No
No
Yes
Yes

And for my total for this column I need to count only the records where the boolean value is true (in this case it would be 3). Does anybody know how to do this?
 
This should do the trick:
Code:
SELECT SUM(CASE WHEN BooleanColumn = 1 THEN 1 ELSE NULL)
FROM TABLE

[morning]
 
Sorry, this should've been posted in Reporting Services forum.

Apologies,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top