title: How to get the records between two different times in one day while having other day data in the same table
body: <p>How to get the records between two different times in one day while having other day data in the same table. </p>
  
  <p>Table:</p>
  
  <pre><code>id reported_date         dept
  1  2017-11-23 09:00:05   IT
  2  2017-11-22 21:00:10   IT
  3  2017-11-23 10:00:09   SC
  4  2017-11-22 22:00:20   SC
  5  2017-11-23 05:00:30   IT
  </code></pre>
  
  <p>The above data is captured based on below criteria: 8:00 pm (YESTERDAY)- 8:00 pm (TODAY) - WILL BE THERE IN today's table.</p>
  
  <p>Now i want to flag the data if it is between 8:00 pm(previous day) - 6:00AM (today) as 'late'. as a new column or as a temp variable.</p>
  
  <p>In the above table the records with 2,4,5 are to be marked as 'late', but you should not use time frame as 8-6 manually. Take the minimum time record after 8:00pm and maxtime before 6:00am.
  Please help me.</p>