hi - have a varchar field that i stupidly put dates in and now i need to convert the type to date
this should do it but i get an error can someone tell me why - the table is called eventlog, the varchar field is called update2 and the new column is called updatenew.
my dates are in DD/MM/YYYY format and i want to convert them to YYYY-MM-DD.
thanks MG
version 5.0.7-beta-nt
error
this should do it but i get an error can someone tell me why - the table is called eventlog, the varchar field is called update2 and the new column is called updatenew.
my dates are in DD/MM/YYYY format and i want to convert them to YYYY-MM-DD.
thanks MG
version 5.0.7-beta-nt
Code:
update eventlog as T1
set updatenew =
(select str_to_date(update2)from eventlog as T2)
where t1.eventid = t2.eventid
error
Code:
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')from eventlog as T2)
where t1.eventid = t2.eventid' at line 3
(0 ms taken)