Multiple IIF statements SSRS expression

Posted on 2011-10-10
Last Modified: 2012-05-12
I'm working on an SSRS report and i'm trying to conditionally format a particular field on the report, but I have to have more than on IIF statement in the expression. I'm fairly still new to writing these expressions and have not been able to get it right yet.

On the properties box for this field on the background color property I have this expression.


I need to add another condtional check which is the Crystal Report Syntax below:

IF {poitem.promise_date} < CURRENTDATE then color (255,204,255) ELSE
IF ISNULL({poitem.promise_date}) THEN COLOR(0,255,0) ELSE NOCOLOR

So far I keep getting errors. Lookin for some help.

Question by:CCIDover
    LVL 10

    Accepted Solution

    I dont know anything about this system but hell, why not stick my oar in anyway!

    The format of the IIF statement looks very similar to that used in Excel.  In that, IF statement are nested.

    eg Single condition IF(A1=1,"It's One","It's NOT One")
    eg Multiple condition IF(A1=1,""It's One",IF(B1=7,"B1 is seven",""))


    You could TRY..


    ..but the chances of me getting this correct staright off are VERY slim.  If you can get the single condtion correct for each, combining them should be easy.

    LVL 21

    Expert Comment

    Try that..
    IIF(Fields!promise_date.Value < Now(), "PINK", IIF(Fields!promise_date.Value Is Nothing,"RED", "WHITE"))

    Open in new window


    Author Closing Comment


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now