Re: Help - Convert Date from longtext to MySQL date format

2003-01-30 Thread Roger Baklund
* Roger Baklund [...] > UPDATE a SET new_date = > ( > MID(my_date,7,4),'-', > MID(my_date,1,2),'-', > MID(my_date,4,2)); huh? How did this happen...? I just checked my outbox, and the message I wrote yesterday[1] contained "new_date = CONCAT(". It seems as the substring "CON" has been rep

Re: Help - Convert Date from longtext to MySQL date format

2003-01-29 Thread Roger Baklund
* Wong Zach-CHZ013 [...] > In table a, the columns are > my_date - longtext > num - int(11) [...] > Q: > How do I convert 08/06/2002 to 2002-08-06 format LONGTEXT is not a good column type for dates, you should use the special 'date' type, see http://www.mysql.com/doc/en/Column_types.html >. To c

Re: Help - Convert Date from longtext to MySQL date format

2003-01-29 Thread rich allen
this command should get your data moved to a new sql table insert into table2 select (concat(mid(my_date,7,4),'-',mid(my_date,1,2),'-',mid(my_date,4,2))) from table1; - hcir On Tuesday, January 28, 2003, at 01:45 PM, Wong Zach-CHZ013 wrote: Hi I have a few tables in a database Z, namely table

Help - Convert Date from longtext to MySQL date format

2003-01-28 Thread Wong Zach-CHZ013
Hi I have a few tables in a database Z, namely table a b c In table a, the columns are my_date - longtext num - int(11) eg: mysql> select * from a; +--+--+--+ | my_date | x| +--+--+ | 08/06/2002 |1 | | 08/07/2002 |2 | +--+--+--