title: Convert INT (date and time) to date in mysql
body: <p>I'm using the old wrong way for dates, and im unable to change it because it will take a lot of time and effort, not to mention a lot of crashes.</p>
  
  <p>I have the following design:</p>
  
  <ol>
  <li>match_day : 31</li>
  <li>match_month : 12</li>
  <li>match_year : 2016</li>
  <li>time: 23:15</li>
  </ol>
  
  <p>And comparing in the normal way <code>ORDER BY (...etc)</code> won't work here, and i see that i need to convert it to time, but the thing is these are INT not string, but i've tried to use the following query: </p>
  
  <pre><code>SELECT match_day,match_month,match_year,time, STR_TO_DATE(match_day+'-'+match_month+'-'+match_year+'-'+time, '%e %c %Y %H:%i') AS date FROM SoccerMatches ORDER BY STR_TO_DATE(match_day+'-'+match_month+'-'+match_year+'-'+time, '%e-%c-%Y-%H:%i') DESC;
  </code></pre>
  
  <p><code>data</code> is NULL, and i don't think it will work because these are INT and i guess we can't use <code>'-'</code> in queries. </p>
  
  <p>this query:</p>
  
  <pre><code>SELECT match_day,match_month,match_year,time FROM SoccerMatches
  </code></pre>
  
  <p>result:</p>
  
  <p><code>30 | 12 | 2016 | 23:15</code></p>
  
  <p>Query im using and its showing false results:</p>
  
  <pre><code>  Select t.*,plan_b.value From SoccerMatches t, plan_b Order by (t.match_year AND t.match_month AND t.match_day) DESC;
  </code></pre>
  
  <p>Any ideas how to make it work / beside creating a new column for it, i want a workaround.</p>