I know this is a newbie question but I need to know how to dynamically change the WHERE clause in a SQL statement based on a drop down selection.
I have a list of supervisors in a drop down. I know how to use each one individually using the parameter, but how do I change the SQL when they select the ALL option?
What you need is a multivalue parameter. The basic steps for setting this up:
@SupervisorIDswith the first dataset as available values.WHERE SuperVisorId IN (@SupervisorIDs)Reporting services will replace the parameter inside the WHERE clause dynamically with a comma seperated list with the values your user has selected, before sending the query to SQL Server.
See this MSDN page for more (detailed) info on the subject.