Home Forums Article Discussions Article Discussions by Author Discuss content posted by Divya Agrawal Finding the Correct Weekday Regardless of DateFirst RE: Finding the Correct Weekday Regardless of DateFirst
Michael Meierruth
SSChampion
Points: 10051
More actions
February 18, 2010 at 10:20 pm
#1121565
In many cases, I can do what I have to do by simply capturing the weekday values for a known saturday and sunday, like so:
declare @dowSat int
declare @dowSun int
set @dowSat=datepart(dw,'20061028')
set @dowSun=datepart(dw,'20061029')