title: MySQL IF with CONCAT AND DATE_FORMAT
body: <p>I have the following statement, which returns empty values for 'label':</p>
  
  <pre><code>SELECT *,
  IF (
      `date_to` IS NULL,
      CONCAT(DATE_FORMAT(`date_from`, '%D %M %Y'), ' ', `location`),
      CONCAT(DATE_FORMAT(`date_from`, '%D %M %Y'), ' - ', DATE_FORMAT(`date_to`, '%D %M %Y'), ' ', `location`)
  ) AS `label`
  FROM `courses`
  ORDER BY `date_from` ASC
  </code></pre>
  
  <p>The <code>date_from</code> and <code>date_to</code> columns are both DATE types, and the second one might contain a default value of <code>0000-00-00</code>.</p>
  
  <p>Any idea what might be causing it?</p>