Posted on Leave a comment

Find next coming Monday and subsequent Friday

DECLARE @startdate smalldatetime
      , @monday date
      , @friday date

SET @startdate = current_timestamp
SET @monday = DATEADD(DAY, (DATEDIFF(DAY, 0, @startdate) / 7) * 7 + 7, 0)
SET @friday = DATEADD(DAY, (DATEDIFF(DAY, 4, @monday) / 7) * 7 + 7, 4)

SELECT @monday "monday", @friday "friday"

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.