Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to substract date tin SSRS Report

Posted on 2011-03-13
6
Medium Priority
?
808 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 375 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

927 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