September 28, 2012 at 8:10 am
I am trying to write an expression like this =iif(isnothing(Fields!ProdCode.Value), "No Product Code", "Product Code is: ", (Fields!ProdCode.Value)).
Whenever I do this it doesn't seem to show the """Product Code is: """ part. I am still pretty new to SSRS and any help would be appreciated.
September 28, 2012 at 8:43 am
Not sure exactly what you're evaluating, but looks to me like you have four arguments in the IIf() function, when it only accepts three.
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
September 28, 2012 at 9:08 am
I basically just want to show "Product code is: " (Fields!ProdCode.Value) if there is one and iif(isnothing(Fields!ProdCode.Value), "No Product Code".
So if you can't do this in a iif statement what is a way to do so.
September 28, 2012 at 1:33 pm
I wasn't saying it can't be done, I was saying you're doing it incorrectly.
IIf() works off of three values, Test, True and False. You're feeding in a fourth value, which it doesn't know what to do with. I think you are trying to concatenate, and just missing it by using a comma, which makes it a fourth value
example:
Your code:
=iif(isnothing(Fields!ProdCode.Value), "No Product Code", "Product Code is: ", (Fields!ProdCode.Value)).
Test = isnothing(Fields!ProdCode.Value)
True = "No Product Code"
False = "Product Code is: "
fourth value = (Fields!ProdCode.Value)
Should be (based on your last post):
=iif(isnothing(Fields!ProdCode.Value), "No Product Code", "Product Code is: " & Fields!ProdCode.Value)
Test = isnothing(Fields!ProdCode.Value)
True = "No Product Code"
False = "Product Code is: " & Fields!ProdCode.Value
The ampersand (&) allows you to concatenate the ProdCode.Value and the string "Product Code is: "
Hope that helps,
Jon
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply