Question

I'm working with sql server report builder and I'm trying to change the value of an image according to a chosen date from a parameter. I've selected external as source and in the expression window I have something like this:

=iif(Parameters!Date.Value <> 11.04.2013, "http://rack.0.mshcdn.com/media/ZgkyMDEyLzEyLzA0L2I1L3doZXJlZG9nb29nLmJoTi5qcGcKcAl0aHVtYgk5NTB4NTM0IwplCWpwZw/4931e287/304/where-do-google-doodles-come-from--ff2932470c.jpg", " ")

but I receive the following message:

Argument not specified for parameter 'TruePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

I'm pretty new to work with the report builder, so please someone help me find out the solution.

Was it helpful?

Solution

I pasted your expression into a sample report set up with a parameter Date, data type Date/Time, and got the same error when using the expression.

I resolved this by changing the data being compared to the parameter in the expression into a string that can readily be converted to a date, so from 11.04.2013 to "11-Apr-2013":

=iif(Parameters!Date.Value <> "11-Apr-2013", "http://rack.0.mshcdn.com/media/ZgkyMDEyLzEyLzA0L2I1L3doZXJlZG9nb29nLmJoTi5qcGcKcAl0aHVtYgk5NTB4NTM0IwplCWpwZw/4931e287/304/where-do-google-doodles-come-from--ff2932470c.jpg", " ")

This stopped the error occurring for me and worked as expected when I selected different dates; i.e. the URL on all dates except 11-Apr-2013.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top