tags:

views:

36

answers:

1

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
That is exactly what i am looking for
Kip Birgen