Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Nested iif expression

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-08-25 : 15:06:32
I'm trying to figure out the syntax on an RS expression, but keep getting compile error msgs. Example below:

If Title value = "Director" OR Title value = "Mgr" AND IF SupervisorName value = "Jane Smith" THEN "Las Vegas" ELSE IF SupervisorName value = "John Doe" THEN "Ft. Laud" ELSE SupervisorName Value
ELSE
IF Title value <> "Director" AND Title value <> "Mgr" THEN
"No Manager"

What would be the RS syntax for a nested if statement?

thx,

John

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-26 : 00:03:31
use nested IIF or Switch. something like
IIF(Fields!Title.value = "Director" OR Fields!Title.value = "Mgr", IIF( Fields!SupervisorName.value = "Jane Smith","Las Vegas",IIF (Fields!SupervisorName.value = "John Doe" ,"Ft. Laud" ,Fields!SupervisorName.value)),IIF(Fields!Title.value <> "Director" AND Fields!Title.value <> "Mgr","No Manager",Nothing))
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-08-26 : 17:02:23
I was very close but my syntax kept erroring out.

Thx,

John
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-27 : 00:07:26
did my soln work?
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-08-27 : 14:52:47
Yes it did!!

Thx a bunch,
Go to Top of Page

JeniQ
Starting Member

29 Posts

Posted - 2009-06-09 : 16:02:17
Helpful, thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-10 : 14:34:41
welcome
Go to Top of Page
   

- Advertisement -