(Assuming you are using a SQLServer data source,) edit your query to include AND column IN (@ParameterName)
.
If your ParameterName
parameter didn't already exist, it should now appear on the list of Report Parameters available from the Report menu. Select it in the Report Parameters dialog and check the Multi-value check box (if not already checked).
If you now try running the report in the preview window, you should find that ParameterName
can have multiple values selected.
EDIT, following comments:
A couple of possibilities -
Using dynamic SQL: hardcode the available values for the multi-select parameters, so that their labels show user-friendly descriptions of the type of e-mail address to be included, and their values hold the field names to be selected. Set the query at run-time to be like "...and eMailID in (" & Join(Parameters!EMailField.Value, ", ") & ")"
. Dynamic SQL is generally deprecated due to the risk of SQL injection attacks, but since you will be hard-coding the only available values, those should not be an issue.
Using IN clauses within IN clauses: hardcode the available values for the multi-select parameters, so that their labels show user-friendly descriptions of the type of e-mail address to be included, and their values hold meaningful codes (such as O, G and S). Then amend the query to be like:
and eMailID in
( (case when 'O' in (@EMailField) then OwnersEmailField else NULL end),
(case when 'G' in (@EMailField) then GeneralEmailField else NULL end),
(case when 'S' in (@EMailField) then ServerEmailField else NULL end)
)