title: How can I word a condition so that an sql statement pulls orders that were resolved up to 2 hours ago?
body: <p>I need a web page to display items that are active and that have been dispatched less than 2 hours ago, I can't figure out the less than 2 hours ago part</p>
  
  <p>I've tried to set a date variable that is 2 hours behind the current time and comparing the time dispatched to the that variable</p>
  
  <pre><code>$DateVar = date('Y-m-d h:i', strtotime('-2 hours'));
  
  $sql="SELECT Id, TransactionId, WONumber, DispatchText, SentBy, Vendor, Dispatched,
               Acknowledged, TimeDispatched, Time
        FROM `DumpsterDispatch`
        WHERE (Dispatched IS NULL
        OR Acknowledged = 'N'
        OR TimeDispatched &gt;= \"$DateVar\")
        AND Id &gt; 1490
        ORDER BY Id DESC LIMIT 100";
  </code></pre>
  
  <p>I expect the web page to display all active orders and any order resolved within the past 2 hours, however with this code it displays all of the resolved orders from the given day</p>