If Thursday show Friday, Saturday and Sunday else show tomorrow

  • 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();
  • I don't understand this part:

    If its Thursday then show Friday, Saturday and Sunday of next week.

    How can all three days be 'shown' simultaneously?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply