title: Getting last 24 hours from current time in sql
body: <p>I am not sure why the dateadd function is not working here.  I am trying to pull only the last 24 hours from current time but i see hours like 3-6 pm of today's date.  the data type is datetime but i am not sure what is going on here. </p>
  
  <pre><code>select Name, location, myDate from myTable where myDate &gt;= DATEADD(hh, -24, GETDATE())
  </code></pre>
  
  <p>when i run the query above the outcome will include this:</p>
  
  <pre><code>2015-03-05 15:00:00.000
  2015-03-05 15:30:00.000
  2015-03-05 16:00:00.000
  2015-03-05 16:30:00.000
  2015-03-05 17:00:00.000
  2015-03-05 17:30:00.000
  2015-03-05 18:00:00.000
  2015-03-05 18:30:00.000
  2015-03-05 19:00:00.000
  2015-03-05 19:30:00.000
  2015-03-05 20:00:00.000
  2015-03-05 20:30:00.000
  2015-03-05 21:00:00.000
  2015-03-05 21:30:00.000
  2015-03-05 22:00:00.000
  2015-03-05 22:30:00.000
  2015-03-05 23:00:00.000
  2015-03-05 23:30:00.000
  </code></pre>
  
  <p>I was expecting not to see these hours at all.  </p>