[英]SSRS question about multiple values in a parameter
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. 现在我可以将语句更改为((@vendor)中的vend_id和(@Name)或@Name =''中的名称),但是用户将不得不一直选择卖方,但这不是我所需要的。
So any ideas on how I can chose multiple values for vendor? 那么关于如何为供应商选择多个值的任何想法?
You could use where (vend_id in (@vendor)) and (name in (@Name) ) in query, then you could set parameter properties like below 您可以在查询中使用where((@vendor)中的vend_id和(@Name)中的名称),然后可以设置如下所示的参数属性
(the type need to be text) (类型必须是文字)
Then you could enter multiple parameters in @aa or leave it as blank 然后,您可以在@aa中输入多个参数或将其保留为空白
Zoe 佐伊
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.