mysql - Converting varchar to date displays 0000-00-00 -


i trying convert column date format. in varchar , displays as: 12/06/2013

i run following query;

update dispatch    set dispatchdate = date_format(str_to_date(dispatchdate, '%d/%m/%y'), '%d-%m-%y');  alter table dispatch       change dispatchdate dispatchdate date; 

however after running query, displays data as: 0000-00-00

i trying change display dd-mm-yyyy not yyyy-mm-dd

0000-00-00 mysql's special way of displaying "zero" or "dummy" date.

like many of mysql's oddities, learn live , suggest you:

update dispatch set dispatchdate = null dispatchdate = '0000-00-00' 

or set whatever value works best you.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -