How to change Data Type with using Case Statement
<p>I have a code like this</p>

<pre><code>SELECT CASE 
              WHEN gift_club_end_date = ' ' THEN ' '
              WHEN gift_club_end_date = '00000000' THEN ' '
              ELSE TO_DATE(gc.gift_club_end_date, 'yyyymmdd')

              END

       FROM gift_clubs gc
</code></pre>

<p>The error is</p>

<p>ORA-00932; inconsistent datatypes: expected CHAR got DATE</p>

<p>The datatype of gift_club_end_date is VARCHAR2.</p>

<p>I would like to change to DATE</p>

<p>For example if there is row</p>

<p>20160802</p>

<p>THEN it shows</p>

<p>8/2/2016</p>

<p>but There are some rows are blank and 00000000</p>

<p>so I want to show/change to Blank on these rows, if blank or 00000000</p>

<p>How can I code like that without causing error</p>

<p>Thank you so much</p>