how does one calculate the beginning of a week from a given date e.g 23 March 2010 beginning of the week is 21 March 2010
+4
A:
Depending on the value of DATEFIRST (I'm assuming 7 here, i.e. Sunday):
SELECT columnname - (DATEPART(WEEKDAY, columnname) - 1) AS week_start
FROM Table1
Then week_end is of course 7 days later.
Mark Byers
2010-03-23 10:27:54
That is exactly what i am looking for
Kip Birgen
2010-03-23 13:05:56