Solved

How to substract date tin SSRS Report

Posted on 2011-03-13
6
790 Views
Last Modified: 2012-05-11
I want to substract the dates in run time in SSRS report, ex:- if I choose end date as 13th of this month, then Start date should be 7th of this date, and I do not want to select the start date, it will automatically substract 6 days from 13th and report will show the data from period 7th to 13th. Please let me know the if it possilbe of not, & How.
0
Comment
Question by:prashant04
  • 3
  • 2
6 Comments
 

Author Comment

by:prashant04
ID: 35125267
Nothing
0
 
LVL 11

Accepted Solution

by:
shorak earned 125 total points
ID: 35127308
select non-query from the start date parameter properties and put this expression in the textbox:

=DateAdd("d", -6, Parameters!Enddate.Value)

where parameters!Enddate.Value is the end date parameter (replace 'Enddate' with the name of your parameter)

You must also order your parameters so the the end date is requested first else this wont work.
0
 

Author Comment

by:prashant04
ID: 35127537
Hi,

I have one more doubt,

Will the date automatically change when, I change the end date after running the report 1st time.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 2

Expert Comment

by:swadhinray
ID: 35134054
When you select the date parameter as End Date that can be used to show all data from last 7 days.

Ex: In the expression if you select Today() it will be “14th March 2011”

So for between condition you have pass the same parameter “BETWEEN Today()-6 AND Today()”
It will be taken as “08th March 2011” AND “14th March 2011”

It depends what control you are using in the Report
0
 
LVL 2

Expert Comment

by:swadhinray
ID: 35143719
@prashant04: Yes the date automatically change each and every time when you run.
0
 

Author Closing Comment

by:prashant04
ID: 35144140
I have applied the same before, but the sugesstion given by him was good
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
SQL Reporting 8 85
SSRS 2012 URL 11 61
How to manually enter several values into a parameter in SSRS 2008 4 32
SSRS Calculation of two fields not working 7 53
In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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