Friday, February 24, 2012

IIF Statement Not Working

I've added the following IIF statement to a table in one of my reports, and
the second IIF statement does not ever evaluate to True. I don't see anything
wrong with the statement. Can anyone help?
=IIF(Fields!DisplayOrder.Value = 0, Fields!Total.Value,
IIF(Fields!Successful.Value = -1, "Successful",Fields!Successful.Value))Are you sure that DisplayOrder and Successful are numeric values? Did you
try this:
=IIF( CInt(Fields!DisplayOrder.Value) = 0, Fields!Total.Value, IIF(
CInt(Fields!Successful.Value) = -1, "Successful", Fields!Successful.Value))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mike Collins" <Mike Collins@.discussions.microsoft.com> wrote in message
news:CC480CA6-B5A7-45DD-BD2E-40F706CA654C@.microsoft.com...
> I've added the following IIF statement to a table in one of my reports,
and
> the second IIF statement does not ever evaluate to True. I don't see
anything
> wrong with the statement. Can anyone help?
> =IIF(Fields!DisplayOrder.Value = 0, Fields!Total.Value,
> IIF(Fields!Successful.Value = -1, "Successful",Fields!Successful.Value))|||I've confirmed that DisplayOrder and Successful are defined as integer. I
also tried your suggestion with the same results.
"Robert Bruckner [MSFT]" wrote:
> Are you sure that DisplayOrder and Successful are numeric values? Did you
> try this:
> =IIF( CInt(Fields!DisplayOrder.Value) = 0, Fields!Total.Value, IIF(
> CInt(Fields!Successful.Value) = -1, "Successful", Fields!Successful.Value))
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Mike Collins" <Mike Collins@.discussions.microsoft.com> wrote in message
> news:CC480CA6-B5A7-45DD-BD2E-40F706CA654C@.microsoft.com...
> > I've added the following IIF statement to a table in one of my reports,
> and
> > the second IIF statement does not ever evaluate to True. I don't see
> anything
> > wrong with the statement. Can anyone help?
> >
> > =IIF(Fields!DisplayOrder.Value = 0, Fields!Total.Value,
> > IIF(Fields!Successful.Value = -1, "Successful",Fields!Successful.Value))
>
>

No comments:

Post a Comment