Created
March 27, 2018 19:56
-
-
Save marcelodeandrade/3cee238cbd5ae248b11cfee1deb27e06 to your computer and use it in GitHub Desktop.
Get the next day of week starting from date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @NextDayID INT = 4 -- 0=Mon, 1=Tue, 2 = Wed, ..., 5=Sat, 6=Sun | |
SELECT DATEADD(DAY, (DATEDIFF(DAY, @NextDayID, GETDATE()) / 7) * 7 + 7, @NextDayID) AS NextDay | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment