M
M
Max Trophy2017-02-02 12:40:05
SQL Server
Max Trophy, 2017-02-02 12:40:05

How to add parameter to Data Set in SSRS? Need a Dynamic Dataset?

Suppose there are 2 tables - tName , tCode
In the SSRS report, the user can select the parameter that he wants to see - Name, Code
How to make a dynamically changing query in the Dataset for this parameter?
I try this, but swears at an error in the request (there are no details, the logs are not available):

=SELECT * FROM [dbo].[t"  + Parameters!version.Value+ "]

bb9099e8c207407a934c43b07f60be37.PNG
Non-working options that have been tried:
=SELECT * FROM [dbo].[t"  & Parameters!version.Value & "]

="SELECT * FROM [dbo].[t"  & Parameters!version.Value & "]"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Georgy Grigoriev, 2017-02-02
@IamKarlson

everything you entered, try to enter in the field when you press the Fx button. as far as I know, in the field in the screenshot, all fields are escaped before being written to the report

M
Max Trophy, 2018-01-16
@kapitoly

If there are not very many parameter values, then try using IIF or SWITCH as an option. If you find the solution you wanted, please share.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question