JonWay
JonWay

Reputation: 1735

IN SSRS How to get Current week Thursday date

I want to get current week thursday name at all time for example today date at the time of asking this question is 12/02/2024 (uk format). I want to return the thursday's date (11/01/2024) going forward the date should dynamically change i wrote this expression

=Today.AddDays(-(Weekday(Today) - 1) + IIf(Weekday(Today) < 6, 4, 11)) it is giving me error

Upvotes: 0

Views: 26

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21703

Assuming that if the report is run on a Thursday then you want the date returned to be the same Thursday then the following should work.

This assumes your system settings default to the weekday starting on a Sunday (weekday = 1) and therefore Thursday is weekday 5, if not just adjust the 5 to match your setup, or pass in the weekday start as an argument to the Weekday() function.

=Today.AddDays( 5 - Weekday(Today) )

Upvotes: 1

Related Questions