Hi all,
I have found the below and i was wondering how I could change it. I want to be be able to always show the the next days data unless it is a Thursday. If its Thursday then show Friday, Saturday and Sunday of next week.
Thanks in advance
DECLARE @StartDate date;
DECLARE @EndDate date;
--set start date as yestreday unless today is Monday then show Friday
SET @StartDate = CASE DATEPART(WEEKDAY, GETDATE()) WHEN 2 THEN DATEADD(DAY, -4, GETDATE())
ELSE DATEADD(DAY, -1, GETDATE()) END;
-- set end dates AS TODAY
SET @EndDate = GETDATE();