mysql>mysql>mysql> SELECT CAST(20041031 AS DATE);+------------------------+| CAST(20041031 AS DATE) |+------------------------+| 2004-10-31 |+------------------------+1 row in set (0.00 sec)