Gossamer Forum
Home : General : Databases and SQL :

SQL Load Data Infile has wrong date format

Quote Reply
SQL Load Data Infile has wrong date format
I hope someone can help, thanks!!!

Problem is I have a txt file that I need to load into a SQL table. Everything is OK except that in the record a persons date of birth is written mm/dd/yyyy. Of course SQL doesn't like that, it likes yyyy-mm-dd. Is there a way I can load the data file into sql specifying the date format? or should I change the column from "dob date" to "dob varchar(10)". or do I need write a php or perl script to individually insert the values after reformating the date????

the table is empty so I dont have to worry about loosing anything.

thanks!