SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


I am having trouble running the following Nested iif statement in an SSRS expression.. any insight...


I am having trouble running the following Nested iif statement in an SSRS expression.. any insight would really helps

Author
Message
sunitha 20026
sunitha 20026
SSC-Enthusiastic
SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)

Group: General Forum Members
Points: 152 Visits: 58

="Reporting Months:- " & join(iif(Parameters!Month.Value ,"1" ,"January"

,iif(Parameters!Month.Value ,"2" ,"February"

,iif(Parameters!Month.Value , "3" ,"March"

,iif(Parameters!Month.Value ,"4" ,"April"

,iif(Parameters!Month.Value ,"5" ,"May"

,iif(Parameters!Month.Value , "6" ,"June"

,iif(Parameters!Month.Value , "7" ,"July"

,iif(Parameters!Month.Value , "8" ,"August"

,iif(Parameters!Month.Value ,"9" ,"Setember"

,iif(Parameters!Month.Value , "10" ,"October"

,iif(Parameters!Month.Value , "11" ,"November"

,iif(Parameters!Month.Value , "12" ,"December" ,Nothing

)))))))))))),",")


pietlinden
pietlinden
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52032 Visits: 16668
Why are the month numbers in quotes? They're numbers, not text.
sunitha 20026
sunitha 20026
SSC-Enthusiastic
SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)

Group: General Forum Members
Points: 152 Visits: 58
pietlinden - Wednesday, July 19, 2017 4:03 PM
Why are the month numbers in quotes? They're numbers, not text.


I tried doing that as well.. but no luck
Thom A
Thom A
SSC Guru
SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)SSC Guru (80K reputation)

Group: General Forum Members
Points: 80173 Visits: 20347
What is it you're actually trying to achieve here? As your first part says "Reporting Months" and your use Join, it suggests that you could have multiple months, however, as you test Month and then nest your IIF in the FALSE evaluation (and Month can only have 1 value) then only one of those IIFs will evaluate to TRUE.

Which of the following are you aiming for your expression to be able to resolve to :
1. Reporting Months:- January, February, March
2. Reporting Months:- March


Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does :-P

Please always remember to encapsulate your code in IFCode Markup. For example [code=sql] [/code].
Click here to read Jeffs Guide on how to post SQL questions, and get swift and helpful answers from the community
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search