reporting-services

IIF statement using BETWEEN


The following IIF expression isn't working for me:

IIF(Fields!Number.Value BETWEEN 1 AND 1000, Fields!Number.Value, "all ok")

Basically I want to list the value if it falls within 1 and 1000 and show 'all ok' if it doesn't.

Please can you advise where I've gone wrong as this is throwing an error.

Thanks


Solution

  • SSRS does not support BETWEEN as far as I can tell.

    enter image description here

    Just use equivalent >= and <= checks:

    =IIf(Fields!Number.Value >= 1 and Fields!Number.Value <= 1000
      , Fields!Number.Value
      , "All OK")