2012-02-14?
How can I modify the above MYSQL statement to format the date into string date format i.e.
2012-FEB-02?
Have a look at MySQLs DATE_FORMAT, it gives you alot of possibilities to format a given date to your needs.
Example:
SELECT DATE_FORMAT('2012-02-14', "%Y-%b-%m");
Result:
2012-Feb-02
... and if you really want the month abbreviation in capital letters (aka FEB instead of Feb, like your example result), simply wrap an UPPER around it:
SELECT UPPER(DATE_FORMAT('2012-02-14', "%Y-%b-%m"));
Result:
2012-FEB-02
02in the original date was the month, yet you wantFEB-02(i.e. month appearing twice, in different forms) in your output?