title: Query to find values that occur during time interval where start time is from previous day
body: <p>Good day, </p>
  
  <p>I'm trying the below SQL query to return all values that occurred between 23:00 HRS to 04:00hrs, regardless of date. </p>
  
  <p>The query works if the start time is smaller than the end time e.g 04:00 hrs - 08:00hrs.
  The column 'time' is a datetime variable
   How can I make this work?</p>
  
  <pre><code>SELECT AVG(Taxi) AS Average,capacity, name, time
  FROM Stations s, TaxiUsage b
  WHERE s.usageID=b.stationId AND TIME(b.time)&gt;= '23:00:00' AND TIME(b.time)&lt;'04:00:00'
  GROUP BY time;
  </code></pre>
  
  <p>The above query runs but returns 'Empty set'</p>