Friday, February 24, 2012

How to add a custom sum

Say I've got a report that lists users and their "Roles"
username1 userid1 userrole
username2 userid2 adminrole
at the bottom of the page, I'd like to print a litte summary of the
report with userroles: 1, adminroles 1.
I know how I'd achieve it with a whole other query, but is there a way I
can avoid it? I know this is probably a simple answer, I just want to
try and do things RIGHT the first time =)
Thanks
Weston WeemsI usually try to push most of this stuff back into the query, but if you are
trying to create a custom sum -- try
sum(iif(Fields!.Role.Value="userrole",1,0))
etc..
Hope this helps
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Weston Weems" <wweems@.Nospamcauseitsucks.gmail.com> wrote in message
news:%23s4rQNxqFHA.3080@.TK2MSFTNGP15.phx.gbl...
> Say I've got a report that lists users and their "Roles"
> username1 userid1 userrole
> username2 userid2 adminrole
> at the bottom of the page, I'd like to print a litte summary of the report
> with userroles: 1, adminroles 1.
> I know how I'd achieve it with a whole other query, but is there a way I
> can avoid it? I know this is probably a simple answer, I just want to try
> and do things RIGHT the first time =)
> Thanks
> Weston Weems

No comments:

Post a Comment