Getting errors with this expression

PhillipK 121 Reputation points
2022-11-30T21:22:56.903+00:00

I wrote this expression but not sure why it is not working.
IIF(IsNothing(Fields!BRIDGE_TYP_WK.Value), " " & "Let With: " & Fields!BRIDGE_TYP_WK.Value))

or

=IF(IsNothing(Fields!BRIDGE_TYP_WK.Value), " " || "Let With: " || Fields!BRIDGE_TYP_WK.Value))

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-12-01T03:02:28.413+00:00

    Hi @PhillipK
    It looks like you are using the IIF function incorrectly. What IIF does is return one of two objects based on the evaluation of the expression, and your expression only has one object.
    For example:
    =IIF(IsNothing(Fields!LocInv.Value), "NONE", "Let With: " & Fields!LocInv.Value)
    265877-1.png
    For more details, you can refer to Decision Functions in this link: expression-examples-report-builder-and-ssrs.
    Best regards,
    Aniya


1 additional answer

Sort by: Most helpful
  1. PhillipK 121 Reputation points
    2022-12-02T14:39:45.46+00:00

    I managed to fix the issue with some help. A colleague alerted me with a missing comma...

    =IF(isNothing(Fields!BRIDGE_TYP_WK.Value), " ","let with" & Fields!BRIDGE_TYP_WK.Value)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.