I have a query that accepts two parameters, location and service. I need the query to select from a different table depending on the service the user selects (a drop down box in SQL Reporting Services). I've tried to use a case statement in the from clause to no avail, and I can't seem to get an if...then to work either.
here's a general example:
select column1, column2, etc
from VARIABLE
where service = @PARAMETER and location = @PARAMETER
The service and location are supplied by the user. the VARIABLE must change based on the service.
For instance, if the service is SAV, then the table (VARIABLE) must be 'no_sav'
any input will be greatly appreciated!
here's a general example:
select column1, column2, etc
from VARIABLE
where service = @PARAMETER and location = @PARAMETER
The service and location are supplied by the user. the VARIABLE must change based on the service.
For instance, if the service is SAV, then the table (VARIABLE) must be 'no_sav'
any input will be greatly appreciated!