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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum an IIF statement in a expression

Status
Not open for further replies.

sparkey75

Technical User
Nov 9, 2009
4
GB
Is it possible to have a sum of an IIF statement either in a Group footer or Report Footer.

I have an IIF statement that works fine in the detail of a table, but require to sum the IIF statement.

many thanks for any assistance that you maybe able to offer.
 
Simply wrap the IFF statement in a sum

Only thing to look out for is making sure that the TRUE/FALSe part of the IIF statement returns the same type of data e.g.

=IIF(Fields!TestField.Value = 1 , Fields!Whatever.Value,0)

is a valid IIF statement but for the SUM, you may need to amend to:

=SUM(IIF(Fields!TestField.Value = 1 , CInt(Fields!Whatever.Value),Cint(0)))

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top