How can I change VARCHAR()
type to DATETIME
using ALTER
in MySQL?
ALTER TABLE <tblName> MODIFY <columnName> dataType constraint;
For your requirement it will be
ALTER TABLE <tblName> MODIFY <columnName> datetime;
Refer http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
Try this query.
ALTER TABLE `table_name` CHANGE `From Date` `From Date` DATETIME NULL DEFAULT '0000-00-00 00:00:00';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With