Jump to content

convert varchar to datetime data type


swtlbee

Recommended Posts

I have taken over a PHP Application/Database(MySQL), the database has a field that dates are entered into and that field is currently a varchar(50) datatype. I need to change the field to a datetime datatype for search functionality purposes.

The way the data was entered originally was July 14, 2008 etc. there are over 700 records in the DB but not more than 1000.

 

Is there an easy way to write a quick conversion script and run it against the DB?

If so can some one help me out with the script or point me in the right direction to learn how to write the script.

 

Thanks in advance for your response...

Link to comment
https://forums.phpfreaks.com/topic/184499-convert-varchar-to-datetime-data-type/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.