title: MySQL check if datetime column is within weekend period
body: <p>I have a table with a datetime column in the database. Is there a way i can write my query to determine if the record is within the weekend period? </p>
  
  <p>I want to display all records and have an additional column in each result row to display Weekend if it meets the criteria of (after Friday 1730hours) or (before sunday 2359hours).</p>
  
  <p>The below is what I currently have but something seems to be wrong. :( any help will be greatly appreciated. :)</p>
  
  <pre><code>SELECT recordTime, DATE_FORMAT(recordTime, "%W %w %T"), (( (DATE_FORMAT(recordTime, "%T") &gt; '17:30:00' AND DAYOFWEEK(recordTime)=6)
      AND (DATE_FORMAT(recordTime, "%T") &lt; '23:59:59' AND DAYOFWEEK(recordTime)=7) )
      OR (DATE_FORMAT(recordTime, "%T") &lt; '23:59:59' AND DAYOFWEEK(recordTime)=0)) AS Weekend
  FROM `waitrecord`
  </code></pre>