title: How do I form an SQL query using DATE_SUB to check for yesterday's data OR if it's Monday, to check for Friday's data?
body: <p>Here's my query:</p>
  
  <pre><code>SELECT *
  FROM daily_records 
  AND date = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
  </code></pre>
  
  <p>I use this to generate a report of everything that happened yesterday. This works great, Tuesday-Friday. However, on Mondays, I want it to be able to search back to Friday (the previous business day, eg <code>INTERVAL 3 DAY</code>).</p>
  
  <p>Is there a way to do this in mySQL? Or do I just need to check the day of the week in PHP before writing the query?</p>