When you use an SSRS expression vs the SSRS built in filtering there are a couple of advantages
I recommend the following:
https://www.textfixer.com/tools/remove-line-breaks.php
I Recommend the following:
WHERE
clause and put your parameter there.
I would suggest using the IN Command for this.
When using multiple values, if the values are text, they must be surrounded with 'single quotes'.
To accomplish this in progress I will set the parameter options to a query that has a SELECT
list that looks like the following.
SELECT CONCAT(CONCAT('''', mytable.myfield),'''') AS value
, mytable.myfield AS label
FROM pub.mytable
Then the main query that the SSRS Report will execute will have a WHERE
clause that looks like the following:
WHERE table.field IN (" + JOIN(Parameters!ParameterName.Value,"," + ")
When you save the report it refuses to save and is saying something about your main query
You probably have a quote that is out of place or you missed an SSRS concatenation operator.
The report will save, however it will not run and it is saying that your main query is broken.
You will need to make 2 dummy parameters that will be deleted later. Copy the sql expression to one of the parameters. After you fill in your other parameter values, this new parameter containing your sql expression will populate itself. Copy the code you your SQL formatting tool and then from there copy your formatted SQL to your favorite SQL IDE (I recommend DataGrip or Dbeaver depending on your situation)
From there you should be able to find where the problem is with your SQL statement either with syntax highlighting or when you try to run it, it will tell you a pretty good idea of what the problem is.