I have been following this website for implementing an optional multi-value parameter. The weird thing is it only works in following conditions:
- "All" (the one with value -1) is selected. Or
- Only 1 value is selected.
If I select more than 1 values, it will always come out with no result. I have also tried to print out the value of =IIF(Parameters!Employee_ID.Value(0)=-1,Nothing,Join(Parameters!Employee_ID.Value,","))
, the output is correct. When -1
is selected, it's value is nothing, when other results are selected, it will display every value splitted with ','
. Any idea? My parameter value is integer.
UDPATE
I found that when I select more than 1 value it will come out no result is because it will always take the 1st value only. For example, if I have selected 4 values which are 4,5,7,9
it will treat it as WHERE id IN (4)
, instead of WHERE id IN (4,5,7,9)
. Why?
Join()
function – Newbie