Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Multiple IIF statements SSRS expression

Posted on 2011-10-10
3
Medium Priority
?
13,540 Views
Last Modified: 2012-05-12
Hi,
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.

=IIF(IsNothing(Fields!promise_date.Value),"Red","White")

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.

0
Comment
Question by:CCIDover
3 Comments
 
LVL 10

Accepted Solution

by:
Alan_White earned 2000 total points
ID: 36943267
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",""))

so...

You could TRY..

IIF(IsNothing(Fields!promise_date.Value),"Red",IIF((Fields!promise_date.Value<NOW(),"Purple","White"))

..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.


0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36943531
Try that..
IIF(Fields!promise_date.Value < Now(), "PINK", IIF(Fields!promise_date.Value Is Nothing,"RED", "WHITE"))

Open in new window

0
 

Author Closing Comment

by:CCIDover
ID: 36945119
Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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…

810 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