Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 SELECT ALL parameter

Author  Topic 

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-21 : 17:34:01
On a report I have a drop down parameter that is populated by a query. I would like to have the option of selecting all records rather that only something on the list. How can I accomplish this?

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-11-21 : 17:43:16
Just don't include a WHERE clause in your select.

You may need to learn SQL:
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp



CODO ERGO SUM
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-21 : 17:49:14
I'm not including a WHERE clause and I know SQL, just when I run my report I would like to be able to select all records from the drop down box.
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-21 : 18:12:21
I would like to re-state my previous question, since the previous question was mis-understood. I have a report in reporting services that contains a parameter lets call it Sales Person Name. When I run the report I would like to be able to select a single sales person or all sales people. Currently the parameter is populated by a query that generates a list of all sales people. However when the report runs I am forced to Select one sales person. What I would like to do is by default run the report for all sales people and then have the ability to select one or all sales people. The SQL that creates my report is fine my question is about parameters in Reporting Services not SQL.
Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-21 : 18:13:06
I think this is what you want
quote:
Adding the ALL member for multivalue parameters

In a SQL Server 2005 Reporting Services report, if you created a valid values list for a multivalue report parameter, a Select All option is automatically added to the available values list. If you upgrade to SQL Server 2005 Service Pack 1 (SP1), the Select All option is no longer automatically created because the option affects performance when used with a multidimensional data source.

You can add an All member as a parameter value by modifying the query that supplies available values. Change the query for the dataset that provides available values to include a literal "All" member, change the query for the dataset for the report data to test for the parameter value or the All member, and set All as the default value for the report parameter. For more information, see Working with Parameters in Reporting Services.



Taken from here
http://msdn2.microsoft.com/en-us/library/ms143380.aspx
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-21 : 18:41:26
Thanks. I am not sure why MS didn't have the option to select every item in a parameter built in. It dosen't make any sense that you would have to write extra code to accomplish this.
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-21 : 19:54:35
''
Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-11-21 : 22:16:49
quote:
Originally posted by rwlopez

Thanks. I am not sure why MS didn't have the option to select every item in a parameter built in. It dosen't make any sense that you would have to write extra code to accomplish this.


See my previous post "If you upgrade to SQL Server 2005 Service Pack 1 (SP1), the Select All option is no longer automatically created because the option affects performance when used with a multidimensional data source."
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-11-22 : 00:04:08
quote:
Originally posted by rwlopez

I'm not including a WHERE clause and I know SQL, just when I run my report I would like to be able to select all records from the drop down box.



Sorry, I didn't notice it was the Reporting Services forum.

You had been asking such basic questions in you prior posts that I assumed that you were just starting to work with SQL and might benefit from a tutorial.





CODO ERGO SUM
Go to Top of Page

rwlopez
Yak Posting Veteran

80 Posts

Posted - 2006-11-23 : 13:17:02
No, I have been doing this type of work for almost seven years. learned on Oracle and then used worked with MS Acess for a long time, but have only been working with T-SQL and Visual Studio for the past eight months. However SQL Server 2005 is a much more robust and powerfull tool and occasionally come across syntax questions and I find this form an efficient way of getting the answers I need from other professionals.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-23 : 14:04:48
select * from yourtable
where (option = 'all members' or option = somecolumn)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -