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)
↧