title: Where Statement with Case based on Current Time
body: <p>I'm looking to create a Case statement so that,<br>
  If the current time is before 11AM, I want the information from yesterday as well as today.<br>
  If the time is after 11AM, I only want the information from today. </p>
  
  <p>Here's what I have right now</p>
  
  <pre><code>FROM [EDC].[dbo].[DIM_DefectData] with (NoLock)
  Where
  Case
      When datepart(hh, GetDate()) &lt; 11 then
          [InitiateDt] &gt; DATEADD(day, DATEDIFF(day, 0, GETDATE()),-1)
      Else
          [InitiateDt] &gt; DATEADD(day, DATEDIFF(day, 0, GETDATE()),0)
  End
  </code></pre>
  
  <p>And ....(additional requirements which are working)</p>