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
 Input Box

Author  Topic 

sureshprpt
Starting Member

33 Posts

Posted - 2012-07-10 : 05:34:48
Hi ,Is there any way to input the from to date for running the coding, instead for change the condition in the query.

For ex. In Visual basic , it will populated the input box to enter the value for the run the report.

Thanks
PS

Thanks & Regards
Suresh

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-07-10 : 07:09:27
You can have parameters for the report and pass in those parameters to the query. So your query would remain the same, except it will be using the parameter it receives. MSDN has a tutorial on exactly this subject - filtering by date here
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-10 : 12:40:47
you can make parameter type as datetime and reporting services interface will provide date picker for you in parameters to pick the date value

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

Go to Top of Page

sureshprpt
Starting Member

33 Posts

Posted - 2012-07-11 : 00:26:28
Can u send some example query please

regards
KPS

Thanks & Regards
Suresh
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-07-11 : 07:18:44
Here is a simple example. First create a stored procedure in your database
CREATE PROCEDURE dbo.GetDateName
@date DATETIME
AS
SELECT DATENAME(weekday,@date);
GO
Now use that in a report as the data set. You will have a parameter @date, for which you can select the date and the report will show the weekday name.

Now replace the contents of the stored proc with what your actual query is.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-11 : 10:41:31
quote:
Originally posted by sureshprpt

Can u send some example query please

regards
KPS

Thanks & Regards
Suresh


try running the query Sunita gave in data tab of your report and when you click execute it will prompt for parameter value. give a test value and run it. it will populate grid with resultset. on refereshing it will automatically add the dataset information as well as the parameter to your report

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

Go to Top of Page
   

- Advertisement -