How to display yesterdays date in SSRS expression

33,857

Solution 1

Use .. =format(dateadd("d", -1, today()), "MMMM dd,yyyy")

Solution 2

If you want add dynamic date or yesterday date in email body using ssrs tool SQL Server 2017, please fellow these steps:

Step 1>

enter image description here

Upload rdl file .

Step 2> Right click on file

enter image description here

Then click manage

enter image description here

Step 3> In Left menu click Subscription

enter image description here

Step 4> Click New Subscription

enter image description here

You will see this window

enter image description here

Then choose data-driven subscription

enter image description here

Then click edit dataset

enter image description here

Then you will get below window

enter image description here

From this select custom source you will get below window

enter image description here

after filling all type query like you want yesterday date then type below query:

enter image description here

Then click Validate Query AND APPLY

IN SUBJECT TAKE VALUE FROM DATABASE AND SEND MAIL

Share:
33,857
SqlLearner
Author by

SqlLearner

Updated on December 22, 2020

Comments

  • SqlLearner
    SqlLearner over 3 years

    In one of the column name, I need to display yesterday's date like - September 4,2014

    I used DateAdd("d",-1,Today()) function to display,but it is displaying like - 9/4/2014 12:00:00 AM.

    How can i get the above format like - monthname,dd,YYYY ?