Conditional count
Hello,
I have a report, for which I want to do a conditional count. The table is something like this:ID Date Description1 30-09-2000 10:36:06 Desc12 15-03-2000 11:45:11 Desc23 12-07-2005 16:21:10 Desc34 10-09-2006 11:12:18 Desc4 (...)I want to count only the entries where the Date field has the value 2000.The expressiona that I am using is the following one:=Sum(IIF(Fields!Date.Value.ToString().Contains("2000"),1,0))It is giving me the right value but my problem is that the value apears repeated. Something like:CountResult 2 2 2 (...)What I want to have is just one value of the conditional count.Has anyone passed by something like this? Any solutions?Thanks and best regardsvjn
August 29th, 2006 12:05pm
By the look of the layout, you are using a table. In the details cell don'tuse the Sum() function you only put this in the group/table footer to give you the subtotal. So if my understaning is correct:
Details cell expression: =IIF(Fields!Date.Value.ToString().Contains("2000"),1,0)Footer cell expression : =Sum(IIF(Fields!Date.Value.ToString().Contains("2000"),1,0))
ID Date Description CountResult===================================================1 30-09-2000 10:36:06 Desc1 12 15-03-2000 11:45:11 Desc213 12-07-2005 16:21:10 Desc3 04 10-09-2006 11:12:18 Desc4 0===================================================TOTAL 2
Free Windows Admin Tool Kit Click here and download it now
August 29th, 2006 2:02pm
You are right. That works perfectly! Thank you Adam.Best regardsvjn
August 29th, 2006 4:51pm
Thanks soo much. You saved me the hassle of creating a stored procedure..lol
Free Windows Admin Tool Kit Click here and download it now
March 22nd, 2008 8:39pm
Thanks ...it works
Thanks
June 14th, 2010 11:25pm
Thanks Lots Dear
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 5:12am