Solved

Date Selector in SSRS Report

Posted on 2012-04-04
3
1,181 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SSRS report 5 44
MS SSRS scale out 13 64
report returning null 21 52
SSRS displaying blank space between rows 6 16
This code started out as a fix for a customer that had incoming data that was hunderds of numbers and words long that was to fit in one column. The problem was that the customer did not want to split words or numbers when wrapping in the column. …
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

13 Experts available now in Live!

Get 1:1 Help Now