question

David 2 1 avatar image
David 2 1 asked

Creating A Multi Value LIKE Expression in SSRS

Hi there, I've got a report that I'd like to include a multi-value parameter that will filter the dataset using multiple LIKE values. I've created the parameter called 'Year' and ticked the box 'Allow Multiple Values' and added a default list of years of '2016', '2015', and '2014'. The source table should be queried with these values on the column YEARS_STATUS which can contain values such as: BOUGHT 2014 SOLD 2014 FOR CASH SOLD 2014 FOR CREDIT FINANCED 2014 BOUGHT 2015 SOLD 2015 FOR CASH SOLD 2015 FOR CREDIT FINANCED 2015 BOUGHT 2016 SOLD 2016 FOR CASH SOLD 2016 FOR CREDIT FINANCED 2016 Therefore if the report user selects 2014 and 2015 I want the report to return all possible values similar to SQL using the LIKE operator, e.g. WHERE YEARS_STATUS LIKE '%2014%' OR YEARS_STATUS LIKE '%2015%' I need this coded into an expression within the report level, not the SQL. So far I've gone into teh Dataset Properties pane and gone to Filters to try to Add one. I selected Expression of '[YEARS_STATUS]' with the Operator 'In' and the Value of '[@Year.IsMultiValue]', however I am getting the error "Cannot compare data of types System.string and System.boolean". Can anyone advise how to correctly create a multi value LIKE expression? TIA
ssrsparametersfilter
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.