Re: Import From Text File (Different Date Format)
Roy: I, too, was looking for how to do this and couldn't find anything. I got about 23,000 records with the date format of: mm/dd/yyyy 00:00:00. The time protion of the record were all 0's so I wanted to ignore them. So here was my process.
1. Changed the field definition for the date field to varchar
2. Imported normally
3. ran this query (after I backed up! :-)
update MYTABLENAME set MYDATEFIELD=concat(
substring(
substring_index(MYDATEFIELD,"/",-1),1,4
),"-",
substring_index(MYDATEFIELD,"/",1),"-",
substring_index(
substring_index(MYDATEFIELD,"/",2),"/",-1
)
)
4. Then I changed the field definition back to datetime
You may want to look at that substring_index command...pretty handy.
Hope that helps!