title: MySQL : WHERE table.column(current_date), evaluate an expression if colum's value at today's date equals a specific value
body: <p>thanks in advance for your help .</p>
  <p>I'm being stuck as I'd like to filter transactions from users that are currently blocked  but tried to perform a transaction. The problem is that the transactions of people that have been unblocked still show up in the results. So ideally I'd like to show only the transactions of blocked users that have the status 'blocked' at today's date, not the ones that have been unblocked in the meantime.</p>
  <p>I have two tables and I'd like to filter by table.column(at date today), I don't know if there's an if statement or ternary expression that would help me evaluate the value of a column at a specific time (today).</p>
  <pre><code>Table 1 : suspended
  
  | blacklisted   | PHONE      | date_suspended | 
  +---------+-------------+------+-----+---------
  | UNBLOCKED     | +34XXXXXXX | 02-03-19  |    
  | BLOCKED       | +34XXXXXXX | 03-05-26  |    
  | BLOCKED       | +34XXXXXXX | 23-09-20  |    
  | BLOCKED       | +34XXXXXXX | 26-02-18  |    
  | UNBLOCKED     | +34XXXXXXX | 15-03-18  |     
  
  Table 2 : transaction
  
   | PHONE      | transaction_date | 
  +---------+-------------+------+-----+---------+-------+
  | +34XXXXXXX  | 06-03-19  |     
  |  +34XXXXXXX | 13-05-26  |     
  |  +34XXXXXXX | 23-09-20  |     
  |  +34XXXXXXX | 06-02-18  |     
  |  +34XXXXXXX | 05-03-18  |     
  
  
  
  SELECT S.blacklisted, T.date_transaction 
  FROM suspended S INNER JOIN transaction T ON S.phone = T.phone
  WHERE IF(S.blacklisted(current_date) like '%blocked%')
  </code></pre>
  <p>Thanks!</p>