Unable to convert a list field to a date/time field

5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 15, 2013   (RSS)

By Codee - April 11, 2013

Client previously had years for cars on their site in a list field. They would like to convert that list field to a date/time field and use the year range function that's in it, but the system gives an error such as

There was an error changing the MySQL Column, the error was:

Data truncated for column 'me' at row 1

I realize one way would be simply to delete the older 'year' field and create a new year field with the date/time type selected...EXCEPT they already have thousands of ads in their database that use the previous list field. Is there a simple way to achieve the goal here?

By Codee - April 12, 2013

Hi Greg,

I'm not versed in direct MySQL manipulation so I'll ask "the" question..."Where" do I run this script exactly?  Do I create a .php page, upload the page and then run it via a browser? Is this something I'm to do through phpMyadmin (which scares me because I don't know what I'm doing in there)? Thanks!

Hi,

You'd need to create a .php page and upload it to your server, then run it in your web browser. You only need to run it once, then you can delete it. 

Cheers

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Codee - April 15, 2013

Excellent - thanks Greg! As always...you guys rock!!!!