all groups > sql server reporting services > december 2004 >
You're in the

sql server reporting services

group:

Dynamic SQL in a RDL file?



Dynamic SQL in a RDL file? Scott Meddows
12/21/2004 3:55:14 PM
sql server reporting services: Can I put parameters and change the SQL in a dataset using expressions?
Thanks
Scott

Re: Dynamic SQL in a RDL file? Bruce L-C [MVP]
12/21/2004 11:22:01 PM
Yes. It is a little tricky but totally doable. First, make sure you have
your expression creating the appropriate SQL String. I usually create the
report with no dataset, just the parameters and then a textbox set to the
expression. This allows me to see the resultant SQL prior to using it for
the dataset. Then I like to first use a static query so that the field list
gets populated. Then (from the generic query window) set the SQL to the
expression. i.e. in the generic query window put

= iif(blah blah, blah, blah) & "whatever else your expression consists of" &
"etc etc"

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

AddThis Social Bookmark Button