0

I have a statement

... where (vend_id in (@vendor)or @vendor ='')
and (name in (@Name) or @Name ='')

so a user can search using either vendor or name. But when i add multiple values to vendor i get this error

(An expression of non-boolean type specified in a context where condition is expected, near',' )

Now I can change the statement to (vend_id in (@vendor) and (name in (@Name) or @Name ='') but the user will have to choose vendor all the time. But thats not what I need.

So any ideas on how I can chose multiple values for vendor?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Roostam
  • 55
  • 1
  • 1
  • 7
  • your question is a possible duplicate of this https://stackoverflow.com/questions/53722780/using-an-in-statement-for-query-in-ssrs/53728289#53728289 – junketsu Dec 11 '18 at 16:45
  • anyways your solution is also same as the one in that post. Depending on if your going Stored Proc route vs direct query (you can use the solution in direct query in post above) for SP route you will have to crate a SPLIT function. – junketsu Dec 11 '18 at 16:47

1 Answers1

2

You could use where (vend_id in (@vendor)) and (name in (@Name) ) in query, then you could set parameter properties like below

enter image description here

(the type need to be text)

Then you could enter multiple parameters in @aa or leave it as blank

Zoe

zoe zhi
  • 164
  • 3