Groups | Blog | Home
all groups > sql server reporting services > february 2006 >

sql server reporting services : Report Parameter in SELECT



Aaron
2/9/2006 6:35:19 AM
I have a report parameter (called Column) that I would like
incorporated in the SELECT Statement. For example, the select is :
SELECT @Column AS Expr1 FROM Table
The report runs after I select the appropriate value for the parameter,
but I do not get the correct data. If I select Test for the column
parameter, then Test appears for the value in the report-----instead of
the correct data.

Does anyone know if building a dynamic column select statement is
possible like this?
Bruce L-C [MVP]
2/9/2006 12:37:28 PM
You have to create an expression for the SQL.

= "Select " & Parameters!Paramname.Value & " as Expr1 from Table"

Be sure you have your field list already because RS will not be able to
detect the fields for you once you use an expression.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

AddThis Social Bookmark Button