title: How to format date_add
body: <p>I have this column 'formatteddate' and it is varchar</p>
  
  <p>now I want to get last 2 days
    <code>WHERE formatteddate &gt; DATE_ADD(CURDATE(), INTERVAL -2 DAY)</code></p>
  
  <p>how to format this part <code>DATE_ADD(CURDATE(), INTERVAL -2 DAY)</code> to looks like this example <code>20180731</code> so that I can compare it to my formattedate.</p>
  
  <p>Thank you in advance.</p>