Balu
Balu

Reputation: 1

SSRS Report Parameters Start date to be set for Friday when Current day is Monday

I have a report parameters start date and end date both set for previous day. I have report subscription that runs on each day of the week. But, when it executes on Monday, I need to change the Default parameter to run from the Prior Friday's date thru Sunday. How can I achieve this? TIA

Upvotes: 0

Views: 717

Answers (1)

AnkUser
AnkUser

Reputation: 5531

I just replicated your use case locally.

For your start date parameter you will need expression as below. It will check if today is Friday (Weekday starts from Sunday) then set start date as Friday from last week else previous day. This shall work.

 =IIF(WeekDay(today)=2,DateAdd("d",-3,today),DateAdd("d",-1,today))

Upvotes: 1

Related Questions