title: Set time portion of a datetime variable
body: <p>I am working on a query that will be an automated job.  It needs to find all the transactions between 8 PM and 8 PM for the last day.  I was thinking of doing something like this</p>
  
  <pre><code>DECLARE @start_date DATETIME
  DECLARE @end_date DATETIME
  
  SET @start_date = DATEADD(DAY, -2, GETDATE())
  SET @end_date = DATEADD(DAY, -1, GETDATE())
  </code></pre>
  
  <p>For an automated query this works good at figuring out the date portion.  But the TIME portion of the variable is the current time that the query executes.  Is there a quick simple way to hard code the time portion of both variables to be 8:00 PM?</p>