title: Date_Format and sort by date
body: <p>I am currently experiencing a problem with sorting a result by a data column which is using date_format. </p>
  
  <p>I have the below dates:</p>
  
  <ul>
  <li>12-03-12</li>
  <li>21-03-12</li>
  <li>25-03-12</li>
  <li>17-04-12</li>
  </ul>
  
  <p>When I perform the query:</p>
  
  <pre><code>SELECT date FROM myTable ORDER date DESC
  </code></pre>
  
  <p>The dates are ordered in the correct order</p>
  
  <ul>
  <li>17-04-12</li>
  <li>25-03-12</li>
  <li>21-03-12</li>
  <li>12-03-12</li>
  </ul>
  
  <p>When I perform the query</p>
  
  <pre><code>SELECT DATE_FORMAT(date, '%d-%m-%Y') as `date` ORDER BY date
  </code></pre>
  
  <p>The dates are now in the wrong order</p>
  
  <ul>
  <li>25-03-12</li>
  <li>21-03-12</li>
  <li>17-04-12</li>
  <li>17-03-12</li>
  <li>14-03-12</li>
  </ul>
  
  <p>I've also tried running the query
  SELECT DATE_FORMAT(date, '%d-%m-%Y') as <code>date</code> ORDER BY DATE_FORMAT(date, '%d-%m-%Y') but has made no difference.</p>
  
  <p>How can I get this to sort in the correct order.</p>