Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reporting data from the last week in ssrs

Posted on 2009-12-17
5
Medium Priority
?
775 Views
Last Modified: 2012-05-08
I've written an SSRS report to list data where a datetime field is greater than the date entered in a report parameter. Problem is I need to schedule this to run now as a subscription to report all data in the last week i.e. each time the subscription runs it reports for the last week (dateadd(dd,-7,getdate()) in sql speak I guess!). Is it possible to set values against parameters in a subscription? I don't really want to change the sql up front to report from a week ago as I still need the flexibility to run the report from any date on request. Was thinking of creating a linked report may be and setting a default parameter value of a week ago, but don't know how to make this dynamic rather than physically hard-coding the date for a week ago.  
0
Comment
Question by:Grffster
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Auric1983
ID: 26072535
Grffster,

Yes, all you need to do is set the Default values for the parameters in BIDS

Reports > Report Parameters

0
 

Author Comment

by:Grffster
ID: 26072687
Do you use a function to calculate today minus a week then in BIDS? If so, what's the function?
0
 
LVL 16

Accepted Solution

by:
Auric1983 earned 1000 total points
ID: 26072714
=DateAdd(DateInterval.Day,-7,today())

0
 
LVL 16

Expert Comment

by:Auric1983
ID: 26072730
Sorry I should have set, set the Default Value to Non Queried and enter in the function
0
 

Author Comment

by:Grffster
ID: 26073324
That's worked great thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

810 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