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
 Parameter Query Question

Author  Topic 

Franco Well
Starting Member

23 Posts

Posted - 2005-01-25 : 13:42:39
I am developing a simple report containing a parameter.

Select Provider
From amProvider
Where (@Prov = '' or Provider = @Prov)

I want to give the user the option of selecting a value from a drop down list or leaving the parameter blank. The values in the dropdown list are obtained from another query.

Select Provider
From AmProvider
Where Provider Like 'A%'

The parameter is set to allow Blank values

However, The report won't run if no value is given for the parameter when the parameter list is generated from a query. If The parameter does not come from a query it pulls all Providers as it should.

Is it possible to leave a parameter that is generated froma a query blank and have the query run?

If so, Please let me know what I need to do to make it work.

Thanks....Franco

jhermiz

3564 Posts

Posted - 2005-01-25 : 16:28:14
WHERE @Prov IS NULL OR Table.Field=@Prov works...should still run the query...what exactly is the problem?


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

Franco Well
Starting Member

23 Posts

Posted - 2005-01-26 : 11:23:24
jhermiz

If the parameter is left blank, the report simply does not process.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-01-26 : 13:38:37
thats funny
I just ran a report and it works on my end on no entry.


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page
   

- Advertisement -