Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
addy01
Starting Member
6 Posts |
Posted - 2006-03-13 : 15:44:21
|
Hi everyone,I have a table that I'm trying to add Totals to the Footer of the report. That in itself is not difficult. Here's where I'm having troubles. The field is a Y/N field and I only want to count where the field is Y. The syntax is where I'm having troubles and the book I have doesn't cover this. Any tips would be greatly appreciated.I was trying =(Count(Fields!XYZ.Value) where XYZ = 'y')Thanks,Addy |
|
jhermiz
3564 Posts |
Posted - 2006-03-13 : 15:53:59
|
Try this:=IIF(Fields!XYZ.Value = 'y', COUNT(Fields!XYZ.Value), "Do the false portion here..") Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url] |
 |
|
addy01
Starting Member
6 Posts |
Posted - 2006-03-13 : 15:58:08
|
I'll try that - Thanks! |
 |
|
addy01
Starting Member
6 Posts |
Posted - 2006-03-14 : 11:19:25
|
unfortunately, =IIF(Fields!XYZ.Value = 'y', COUNT(Fields!XYZ.Value), "Do the false portion here..") wouldn't work. The scope comes out wrong. CountIf seems to be the best way to get this done, but isn't supported in RS. Any other thoughts? |
 |
|
jhermiz
3564 Posts |
Posted - 2006-03-14 : 11:32:42
|
quote: Originally posted by addy01 unfortunately, =IIF(Fields!XYZ.Value = 'y', COUNT(Fields!XYZ.Value), "Do the false portion here..") wouldn't work. The scope comes out wrong. CountIf seems to be the best way to get this done, but isn't supported in RS. Any other thoughts?
Create another dataset, with another sproc that returns the count based on your where condition. Drop it in its own table header / footer. Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url] |
 |
|
|
|
|
|
|