0o0o0 Posted October 18, 2008 Share Posted October 18, 2008 have two tables .. ones full of data.. and the other empty.. I want to move all from TABLE_A to TABLE_B.. while converting a text date to real DATE.. my guess... $sql = "INSERT INTO TABLE_B SELECT col1, (STR_TO_DATE(col2, '%m/%d/%Y')) as col2, col3,col4,col5,col6 from TABLE_A "; this does not work for me.. and the date does not convert. see any errors? ( identical columns identical tables) Link to comment https://forums.phpfreaks.com/topic/128983-send-all-contents-from-one-table-to-another-and-converting-text-date-to-realdate/ Share on other sites More sharing options...
Barand Posted October 20, 2008 Share Posted October 20, 2008 try CREATE TABLE tableB SELECT col1, (STR_TO_DATE(col2, '%m/%d/%Y')) as col2, col3,col4,col5,col6 FROM TABLE_A Link to comment https://forums.phpfreaks.com/topic/128983-send-all-contents-from-one-table-to-another-and-converting-text-date-to-realdate/#findComment-670222 Share on other sites More sharing options...
Recommended Posts