Solved

How to substract date tin SSRS Report

Posted on 2011-03-13
6
786 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

Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
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. …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

14 Experts available now in Live!

Get 1:1 Help Now