Search code examples
visual-studio-2008ssrs-2008-r2

SSRS IIF DefaultValue Expression ERROR


Trying to string together a SSRS condition that set a parameter dynamically.

The user chooses 2 dates @StartDate and @EndDate. The expression i am trying to write will check to see if the 2 dates match and if they are the same datename as well. and if they do returns the value "Default" However I keep getting :

enter image description here

Here is the expression so far :

=IIF(FORMAT(Parameters!StartDate.Value, "dddd") = "Monday" & FORMAT(Parameters!StartDate.Value, "dddd") = "Monday" & Parameters!StartDate.Value = Parameters!EndDate.Value, "Default", "")

Solution

  • & <> AND.

    Use AND instead in the expression to combine Boolean expressions.

    =IIF(FORMAT(Parameters!StartDate.Value, "dddd") = "Monday" AND FORMAT(Parameters!StartDate.Value, "dddd") = "Monday" AND Parameters!StartDate.Value = Parameters!EndDate.Value, "Default", "")
    

    & is used in SSRS to concatenate strings ("ABC" & "DEF").