SqlLearner
SqlLearner

Reputation: 793

How to display yesterdays date in SSRS expression

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 ?

Upvotes: 7

Views: 44075

Answers (2)

Rohit Kharat
Rohit Kharat

Reputation: 86

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

Upvotes: 1

Tak
Tak

Reputation: 1562

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

Upvotes: 13

Related Questions