title: Delete all data except for the last 2 days using SQL
body: <p>I am trying to delete all data from my table except the last 2 days; also deleting today's data. </p>
  
  <pre><code>delete from myTable where myDate &gt; DATEADD(day, DATEDIFF(day, -2, GETDATE()), -2)
  </code></pre>
  
  <p>this is not working for me
  sample data</p>
  
  <pre><code>2015-03-06 18:00:00.000
  2015-03-06 18:30:00.000
  2015-03-06 19:00:00.000
  2015-03-06 19:30:00.000
  2015-03-06 20:00:00.000
  2015-03-06 20:30:00.000
  2015-03-06 21:00:00.000
  2015-03-06 21:30:00.000
  2015-03-06 22:00:00.000
  2015-03-06 22:30:00.000
  2015-03-06 23:00:00.000
  2015-03-06 23:30:00.000
  2015-03-05 00:00:00.000
  2015-03-05 00:30:00.000
  </code></pre>