Solved

Date Selector in SSRS Report

Posted on 2012-04-04
3
1,183 Views
Last Modified: 2012-04-23
Hi,
I have built a report with 2 date parameters, @From and @To. They are of data type date/time, so the user can select start and end dates from a calendar box, which works great.
(@From and @To are in my SQL code)


I would like to have, alongside this, a drop down list with  Current Month, Previous Month, and maybe some other common selections.

How can I go about this?  I want to set the value of @To and @From based on what is chosen in the drop down, if possible. That way I wont have to do anything with my SQL code.
I tried to make a text variable called 'Quick Select', with available values of "current month", "Previous month",  etc, but it is greyed out until the calendar boxes are filled in, which defeats the purpose of it.

The screenshot shows an example of what I am after, this one was made in Crystal though.
dates.jpg
0
Comment
Question by:joemccnz
3 Comments
 
LVL 2

Expert Comment

by:davidi1
ID: 37810435
its dependancy issue.., first create the "Quick Select" using query & based on the selection, populate your From & To Date.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 37813728
I see a couple of possible scenarios to get this working but none of them will be considered to be "easy".  But I'll give it a go...

Do you really want to have both the From and To in combination with the dropdown on your report?  Because that's already one step into making it complicated.  You'll need to look into cascading parameters to get that working, and cascading parameters are nice... as long as you don't want them to refresh every time the initial selection is changed.
See here for more info on what I mean: http://www.bp-msbi.com/2011/04/ssrs-cascading-parameters-refresh-solved/

For as much as it's possible, I'd try to handle the date logic in a stored procedure.  Try thinking about what you need (I'm not saying that you haven't already), and come up with a different scenario that's easier to implement.  Perhaps you can have two parameters: one of type datetime where the user selects a date and another with a dropdown containing items like "Full Month", "Previous Month", "Previous Week"...  Then pass both of those parameters into a stored procedure and handle them whichever way you see fit.

In case you're new on using SPs in combination with SSRS, a couple of articles:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_1931-Reporting-On-Data-From-Stored-Procedures-part-1.html
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_2002-Reporting-On-Data-From-Stored-Procedures-part-2.html

Any further questions, just shout and we're here to help you!
0
 

Author Comment

by:joemccnz
ID: 37883054
Cheers ValentinoV, Ive decided to simplify it and do away with the To and From.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sharepoint 2013/SSRS error long reports 11 516
How to create an interactive data pie chart 4 118
SSRS Dynamic Column Names 3 60
SSRS 2008 Multi Value Parameter Filter using OR 3 32
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now