I have a csv file with several thousand game dates in it, but they are all in the format MM / DD / YYYY
2/27/2011,3:05 PM,26,14
(26 and 14 are the identifier of the #s command), and trying to put them in SQL like this just causes the PDF to fit in the date field of my table. This is the command I tried to use:
LOAD DATA LOCAL INFILE 'c:/scheduletest.csv' INTO TABLE game
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(`date`, `time`, `awayteam_id`, `hometeam_id`);
but then again, that would not have given the correct dates. Is there a way I can convert the date when she tries to insert it? I found another SO question similar to this, but I couldn't get it to work.
source
share