SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 From and To Date parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sz1
Constraint Violating Yak Guru

United Kingdom
451 Posts

Posted - 11/06/2012 :  07:03:13  Show Profile  Reply with Quote
Hi

This is really simple in Crystal reports but finding it odd in SSRS. I can add a createddate field paramter on a filter in a report and make it a datetime type in the properties. I dont see the option to use the datetime field to be able to select a start and end date. There is a From and To option in the filter but this requires entering a datetime value from the filter and not from the parameter prompt. All I want to do is have a start date and an end date for users to enter the date search.

Does anyone know how to do this either direct from the parameters report data view or from a filter?
Thanks in advance!

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 11/06/2012 :  12:30:11  Show Profile  Reply with Quote
hmm...didnt get your actual problem. As I understand you've just created the filter and not linked it to report parameter.

the way to do it is to either create the parameters first of type datetime and then use them in expression for filter like

=Fields!StartDate.value =Parameters!StartDate.value
=Fields!EndDate.value =Parameters!EndDate.value


another easier way is to just include two parameters in query/procedure used for dataset and while executing it from datatab in BIDS (Visual Studio) it prompts for the parameters. Give some test value and run it to fill the dataset. On click refresh button on top it will automatically add filetrs to dataset based on the query parameters and also create report parameters on the fly based on this and links it to filters. You can go ahead to parameter tab to change properties of these autogenerated parameters if you want like changing name,prompt, type etc


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

Go to Top of Page

sz1
Constraint Violating Yak Guru

United Kingdom
451 Posts

Posted - 11/07/2012 :  04:18:30  Show Profile  Reply with Quote
As I understand it when I create a filter in the query window it automatically sets the parameter in the report view, at least I have seen it appear when I create a filter first. When I create a parameter first then do I use Available Values and then Specify Values for the filter? I tried this by adding a label and then for Value used the fx to add the dataset to add the field but I get errors doing so? Also tried getting values from a query and selected the dataset from there which shows all the entries in the field. I normally use declare statements in view or procedures as you say for start and end dates, could I add a calcualted field to include the SQL for that in SSRS?

If you could send me a screenshot of a correct parameter setup that would be handy, I know its not tricky what I'm trying to do but new to SSRS reporting.

Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 11/07/2012 :  10:13:36  Show Profile  Reply with Quote
when you create parameters you can define set of available value but you cant map them to actual dataset fields. the mapping should be done in dataset table for filtering. If you want parameters to be populated with some values from db you need to create a separate dataset for that and then map it to parameter in available values combo.

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000