Say I have a dataset in SSRS called DataSet1 that looks like this:
CREATE TABLE #data
(ID int, Value int, UserID varchar(2))
INSERT INTO #data VALUES
(1, 1000,
You will have to have a separate data set for your parameter query and yes you got that part right, for the given data set:
SELECT DISTINCT UserID
FROM TABLE
This query will be used to populate the drop down list of your parameter. (Multiple values allowed or not).
For you Main query:
if you allow Multiple Selection for @UserID parameter you will write you main Data set query with IN operator as below:
SELECT ID, Value, UserID
FROM table
WHERE (UserID IN (@UserID))
If you only want users to be able to select only one value at a time the you can write the above query with a where clause something like WHERE UserID = @UserID.
Make sure you map the variables correctly. But you will have to have a separate query for your drop down list.