title: SQL select between two dates and time
body: <p>I need to select all data from yesterday of 6:59 PM up to 7:00 PM of today everyday.</p>
  
  <p>Data to be selected is a <code>datetime</code> field.
  The date is not constant as I am going to generate it everyday with this query.</p>
  
  <p>I am using MS SQL Server 2008. Here is a sample test data.</p>
  
  <p><a href="https://i.stack.imgur.com/yhBnC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yhBnC.png" alt="Sample DateTimeField Data"></a></p>
  
  <p>Could you give me an idea how am i going to do it</p>
  
  <pre><code>SELECT transaction
  FROM test_tbl
  WHERE ...
  </code></pre>