I’m pretty proud of this little beastie. I’m also pretty sure that it can be reduced a bit, but not right now. Fire up your T-SQL enviroments!
DECLARE @desiredDate datetime
SET @desiredDayOfWeek = 4 --& Let's find, oh, Tuesdays. I like Tuesdays, usually.
SET @desiredDate = DATEADD(dd, ((DATEPART(ww, DATEADD(ww, 1, GETDATE())) - DATEPART(ww, DATEADD(dd, 7%((@desiredDayOfWeek - DATEPART(dw, GETDATE())) + 7), GETDATE()))) * 7) + (-1 * (DATEPART(dw, GETDATE()) - @desiredDayOfWeek)), GETDATE())
Whee!
January 26th, 2006 | Computer, Microsoft, Technology
Ryan, send me your freakin’ paper, send me some else’s competent summary of the thing, or shut up about the damn slingshot!
Chuck Norris roundhouse kicks people who keep talking about their slingshot.
Comment by Noel — Friday, January 27, 2006 @ 5:10 pm