Subtract days, weeks etc in SSRS

Subtract days, weeks etc in SSRS

Yet another useful date subtraction technique, this time via SSRS and expressions. If you’re not using SQL datasets to calculate your dates and times, then this will be of use to you:

=DATEADD(DateInterval.Year, -1, Today())
=DATEADD(DateInterval.Year, -1, Fields!StartDate.Value)
=DATEADD("M",-1,Today())
=DATEADD("M",-1,Fields!StartDate.Value)
=DATEADD(DateInterval.WeekOfYear, -1, Today())
=DATEADD(DateInterval.WeekOfYear, -1, Fields!StartDate.Value)
=DATEADD("D", -1, Today())
=DATEADD("D", -1, Fields!StartDate.Value)
Mike250

Australian. Sport. Passionate Cricket Fan. Go Pro. Abseiling. Snorkeling. Travel. Golf R. SQL Server Developer. Three sons. One daughter. Last Trip: New York.

Related Posts
2 Comments
    • Jules
    • On: April 18, 2016

    Really useful thank you – solved an annoying problem for me very quickly.

    Reply
    • You’re most welcome, glad it helped šŸ™‚

      Reply
Leave a comment

Your email address will not be published. Required fields are marked *