title: Problem when using DATEADD and DATEDIFF to get the start day (Monday) of the week
body: <p>I use this sql to get the start day of the week (Monday) when users enter date of other days</p>
  
  <p>@StartDate has format (yyyymmdd)</p>
  
  <p>SQL:      <code>CAST(convert(varchar(12),DATEADD(week,DATEDIFF(week,0,@StartDate),0),112) as int</code></p>
  
  <p>The problem is that when entered date is from Tuesday to Saturday, it returns to the correct Monday of the current week. Yet when the entered date is sunday, it returns date of monday next week.</p>
  
  <p>can anybody tell me what i did wrong
  <br/> thank you</p>