MySQL: How to convert Char into Date?
<p>I want to compare two fields with the same datatype which is char(8) wherein the input is for DATE. </p>

<p>I used</p>

<pre><code>select * from TABLE where DateChar1 &lt;&gt; DateChar2;
</code></pre>

<p>However, upon checking the said fields they have a different input.. </p>

<pre><code>DateChar1 = '03102015'

DateChar2 = '20150310'
</code></pre>

<p>I already tried but returns NULL.</p>

<pre><code>DATE_FORMAT(DateChar1 , "%d/%l/%Y") as DateChar1 
DATE_FORMAT(DateChar1 , '%Y, %d %m') as DateChar1
DATE_FORMAT(DateChar2 , '%Y, %d %m') as DateChar2 
DATE_FORMAT(DateChar2 , '%Y, %d %m') as DateChar2 
DATE(DateChar1 ) as (DateChar1 
DATE(DateChar2 ) as DateChar2 
</code></pre>

<p>thanks for the help in advance.</p>