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

I'm an Australian Chief Analytics Officer passionate about data science, visual insights, and all things sportโ€”particularly cricket. An adventurer at heart, Iโ€™ve gone from abseiling cliffs to snorkeling in crystal-clear waters, sleeping in the wilds of Africa, and exploring destinations worldwide, with my latest trip taking me to Bali. When I'm not diving into data or analytics, I'm spending time with my three sons and two daughters, attempting to hit sixes for my local cricket club, reviewing chicken schnitzels or honing my craft around a coffee machine.

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 *