Parameters in SQL Query
Because the SQL Query Data Source runs as a prepared statement, passing parameters into this query type works a little differently.
Instead of placing a parameter within { } characters like the Basic SQL Query, we place a ? where we would like to pass in a parameter. Doing this will actually create a new text area below the query area for your parameter. This smaller text area is where you can pass a parameter into the query. You can pass in Tag values or Report Parameters, and since the parameter area allows expressions, you can use expressions to create any value you like from a combination of Tags and Report Parameters.
You can add as many of these to a query as needed, with new parameter areas popping up underneath as they get added. To help keep track of what parameter corresponds to which "?", when entering in a value into the parameter area, its associated "?" will highlight to show you which parameter you are currently working on.