title: finding the start day (Monday) of the current week
body: <p>Looking for a SQL query/queries that would determine the start day (Monday) of the current week.</p>
  
  <p>Example: 
  If today is -> then the start of the week is</p>
  
  <pre><code>Sat Oct 09, 2010 -&gt; Start of the week is Monday Oct 04, 2010
  Sun Oct 10, 2010 -&gt; Start of the week is Monday Oct 04, 2010
  Mon Oct 11, 2010 -&gt; Start of the week is Monday Oct 11, 2010
  Tue Oct 12, 2010 -&gt; Start of the week is Monday Oct 11, 2010
  </code></pre>
  
  <p>I have seen many "solutions" on Google and StackOverflow. The look something like:</p>
  
  <pre><code>SET @pInputDate = CONVERT(VARCHAR(10), @pInputDate, 111)
  SELECT DATEADD(DD, 1 - DATEPART(DW, @pInputDate), @pInputDate)
  </code></pre>
  
  <p>This fails because:
  Sun Oct 10, 2010 -> start of week Monday Oct 11, 2010 (which is incorrect).</p>