title: Today Production - SQL Date Calculation case when
body: <p>I have an issue regarding date calculations.</p>
  
  <p>I have a datetime column called <code>CreatedLocalTime</code> date with this format: <strong><code>2015-11-15 19:48:50.000</code></strong></p>
  
  <p>I need to retrieve a new column called <code>Prod_Date</code> with:</p>
  
  <pre><code>if “CreatedLocalTime” between 
      (CreatedLocalTime 7 AM) 
      &amp; (CreatedLocalTime+1 7 AM)
   return CreatedLocalTime date with DD/MM/YYYY format
  </code></pre>
  
  <p>On other words, today production = sum of yesterday from 7 AM till today at 7 AM.</p>
  
  <p>Any help using case? </p>