简体   繁体   中英

SSRS parameters - specifying multiple values in one label

Good evening all,

for a parameter in a ssrs report I want to specify the values available. Every label will have the same value, apart from one label - this one will have two values. Everything works fine if I just specify one value per label. But if I use two for one label, it will show error "ORA-01722: invalid number".

I assume I am missing some formatting here to make sure I can pass on two values? The sql query is correct I believe, it specifies the bind by doing "...WHERE account_no in (:account)..."

Below an example of what I am trying to do. Numbers are random

例子

Would appreciate any help here. Thanks

As you used IN SSRS will inject the values into your dataset query. If the parameter is text (ignore the fact it's actually numeric), the query will try to process something like SELECT * FROM myTable WHERE account_no IN ('3333,4444') which is obviously wrong.

You'll need to parse the values in your dataset query with something like this

SELECT * FROM myTable 
WHERE account_no in (SELECT [value] FROM string_split(@account, ','))

You haven't mentioned what database you are using, the above is based on SQL Server but the same principle applies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM