Solved

Date Selector in SSRS Report

Posted on 2012-04-04
3
1,197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

631 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