Friday, February 13, 2009

Find day of the Current Week

Very Simple Script which find Day of the Current Week;


SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 0)
Result:
2009-02-09 00:00:00.000 --Day(0) --Monday


SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 4)
Result:
2009-02-13 00:00:00.000 --Day (4) --Friday

No comments: