Quantcast
Channel: Answers for "sql for day of the week in the future"
Viewing all articles
Browse latest Browse all 8

Answer by Squirrel

$
0
0
simplest way without complicated arithmetic operations is declare @dte date select @dte = '2011-10-17' select dateadd(day, case datename(weekday, @dte) when 'Sunday' then 2 when 'Monday' then 1 when 'Tuesday' then 7 when 'Wednesday' then 6 when 'Thursday' then 5 when 'Friday' then 4 when 'Saturday' then 3 end, @dte)

Viewing all articles
Browse latest Browse all 8

Trending Articles