How to run your SSRS Report for Past “N” Days from the Report run Date

Introduction

If have a parameter on our report to see the past “N” days data on our report, we can perform the following steps.

Step 1:

Add a new Parameter, say “Days”

Step 2:

Under the Available Values Section, Add a new Value for the Parameter with value as 7 and expression having the following formula:

=DateAdd(“d”,-7,Globals!ExecutionTime)

Step 3:

Under the Default Values Section, Add a new Value for the Parameter with expression having the following formula:

=DateAdd(“d”,-7,Globals!ExecutionTime)

Step 3:

In your Dataset, add the following Filter Condition in the XML.

<filter type=”and”>

<condition attribute =”modifiedon”  operator=”on-or-after” value=”@Days” />

</filter>

Conclusion

Thus, now you can view your report with records modified in the past “N” days.


Share Story :

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :

Enter your email address to follow this blog and receive notifications of new posts by email.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close