title: Find records produced in the last hour
body: <p>I have a <code>smalldatetime</code> field named <code>myTime</code> recording when the record was created. I need the syntax that selects records created within the last hour.</p>
  
  <p>thought it would be:</p>
  
  <pre><code>and DATEDIFF("hh", datePart(hh, myTime), DatePart(hh, GETDATE()) &lt; 1
  </code></pre>
  
  <p>where <code>datediff</code>  </p>
  
  <ol>
  <li>looks for hours</li>
  <li>looks at the hours portion of the data in myTime as starting</li>
  <li>looks at the hours portion of now for ending</li>
  <li>produces an int that gets compared to '1'</li>
  </ol>
  
  <p>the results I'm getting are clearly way, way off but I don't know why.</p>
  
  <p>ADDENDUM: Since both answers essentially agree, the fact that this isn't returning anything for me must trace to how my table's been created. It's created by LogParser working against IIS logs and has date/time info spread across 2 different fields. <code>Date</code> holds just the date info where today's records all look like: <code>2010-06-08 00:00:00.000</code> and the Time field looks like: <code>2010-01-01 15:02:51.000</code> (the date portion for all records is Jan 01 of 01).</p>