While there are many code samples for the individual pieces of this question, as a neophyte with Report Designer, I cannot get the syntax for this correct.
I have a textfield that I want to display a SUM of “Held Hours” from one of three DataSets, and this is determined by another field in that same DataSet having a value of “H.”
So taking it in pieces, this works to sum ALL hours in ReportDataset.
=Sum((Fields!RegHrs.Value + Fields!OvtHrs.Value),"ReportDataset")
Now, somehow i need to nest that in an IIF. I need that SUM expression to be the “True” return from the IIF when the BillStatus = “H.”
IIF(Fields!BillStatus.Value = "H",true,false)
I cannot seem to figure out how to combine the IIF and the SUM so that they pull from “ReportDataset” and are syntactically correct.
I’ve been trying various permutations of this:
=Sum(IIF(Fields!BillStatus.Value = "H",((Fields!RegHrs.Value + Fields!OvtHrs.Value),"ReportDataset"),0))
Any pointers?
New Info:
The following reports as syntactically correct, but gives me 0 for a return value.
=Sum(IIF(Fields!BillStatus.Value = "H", (Fields!RegHrs.Value + Fields!OvtHrs.Value),0),"ReportDataset")
There should be hundreds of hours returned.
Try a nested sum:
Or: