View Single Post
Old 03-23-2007, 09:37 AM  
BradM
Confirmed User
 
Join Date: Dec 2003
Location: 1123,6536,5231
Posts: 3,397
MySQL / PHP gurus help with this code?

I have tried a couple help forums and #php but no luck so far.

I have a varchar field (date) with a date in MM-DD-YYYY format. I need to convert this to my (date2) field which is DATE in the YYYY-MM-DD format. Here is the sql statement I have so far - and it doesn't work:

UPDATE b1datefix t1, b1datefix t2 SET t1.date2 = DATE_FORMAT(t1.date,'%Y-%m-%d') WHERE t1.id=t2.id;

Any ideas?
BradM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote