title: How to get the data for the current week from MSSQL
body: <p>I wanted to know how I can get the records for the current week. </p>
  
  <p>The query I am using is  :</p>
  
  <pre><code>DECLARE @TableX TABLE
  
  ([Date] DATETIME)
  
  INSERT INTO @TableX
  
  SELECT '2014-2-17' UNION ALL
  
  SELECT '2014-2-18' UNION ALL
  
  SELECT '2014-2-19' UNION ALL
  
  SELECT '2014-2-20' UNION ALL
  
  SELECT '2014-2-21'
  
  
  SELECT * FROM @TableX
  
  WHERE Date &gt;= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()) / 7 * 7, 0)
  AND  Date &lt;= DATEADD(DAY, DATEDIFF(DAY, -1, GETDATE()), 0)
  </code></pre>
  
  <p>The query I have wrote doesn't produce the data correctly ? Can anyone please tell me what is wrong in the query.</p>
  
  <p>The records I get from this query is :</p>
  
  <pre><code>2014-02-17 00:00:00.000
  2014-02-18 00:00:00.000
  </code></pre>