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
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Parameter problem

Author  Topic 

bh0526
Yak Posting Veteran

71 Posts

Posted - 2010-03-28 : 17:48:05
I want to add a parameter to an existing report. I am using a text SQL statement. There are already 2 parameters for start date and end date. These work correctly. But now I want to add a third parameter called Service.

First, I add this to my WHERE statement in my SQL:

AND service LIKE '%@Service%'

Now I click on the Data tab, then click the .. (2 dots), then click the Parameters tab, then add my new parameter and I name it @Service. But when I try to execute my query by clicking the ! button, my new parameter does not appear, only my original 2 parameters. What I am doing wrong?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-29 : 00:35:33
you should be adding parameter to query behind rather than to parameter tab. After adding to query and clicking ! it will prompt for new parameter also and on refreshing it will add it to parameters tab as well.

Also your query should be

AND service LIKE '%' + @Service + '%'

rather than what you've now

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

bh0526
Yak Posting Veteran

71 Posts

Posted - 2010-03-29 : 06:45:39
That did it. Thanks for your help!

Bob
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-29 : 11:44:21
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -