SQL Reporting Services 2000
-
I have a report that I created that uses parameters. One of the parameters queries data from a table and inserts it into a combobox. My question is: How do I insert a wildcard into a queried parameter? For example if the query returns a list of teams how can I add a wildcard to that dataset so I can also have the option to pull of all the teams? Any help would be appreciated. -Garrett
-
I have a report that I created that uses parameters. One of the parameters queries data from a table and inserts it into a combobox. My question is: How do I insert a wildcard into a queried parameter? For example if the query returns a list of teams how can I add a wildcard to that dataset so I can also have the option to pull of all the teams? Any help would be appreciated. -Garrett
O.K. So I decided to create a stored procedure that takes a sql statement as a parameter and then adds a wildcard to the first row. This seemed to work fine. Code is below:
CREATE PROCEDURE sp_add_wildcard @sql nvarchar(1000) AS create table #paras ( label nvarchar(255), value nvarchar(255) ) insert into #paras (label,value) values ('(ALL)','%') execute('insert into #paras (label,value) ' + @sql) select * from #paras drop table #paras GO
-
O.K. So I decided to create a stored procedure that takes a sql statement as a parameter and then adds a wildcard to the first row. This seemed to work fine. Code is below:
CREATE PROCEDURE sp_add_wildcard @sql nvarchar(1000) AS create table #paras ( label nvarchar(255), value nvarchar(255) ) insert into #paras (label,value) values ('(ALL)','%') execute('insert into #paras (label,value) ' + @sql) select * from #paras drop table #paras GO
Usually in my RS datasets, I do a union SELECT 'All' as label, '%' as value union SELECT label, value from myLookupTable
Michael CP Blog [^] Development Blog [^]