I am creating some reports in ReportServer (dynamic list type), one of them is retrieving info from SQL Server for events in the past week.
In SSMS, it's simple enough, I get the needed info (timewise) with
... WHERE DATEPART(week, event_date) = DATEPART(week, DATEADD(d, -5, GETDATE()))
preceded by a
SET DATEFIRST 1;
statement so that Monday is set as the first day of the week.
Unfortunately, ReportServer does not accept the SET DATEFIRST
statement as part of the query, so after leaving it out, the data returned ranges from Sunday to Saturday instead of Monday to Sunday. I cannot make global changes to the database (or server, for that matter).
How can I get round this?