Page 1 of 1

Importing Data to sql database from excel

Posted: Mon Mar 01, 2010 10:20 am
by dave.hawksworth
I have an sql database with a date field and I want to populate it with a large ammount of records from an excel spreadsheet.
Using phpMyadmin the only way I have found to import the data from the spreadsheet is by converting it to a csv file and then importing.
Unfortunately this method imports all the text fields correctly but the date field is imported as a series of zero's in the date format.
Does anyone know a way round this?
Thanks
Dave

Re: Importing Data to sql database from excel

Posted: Mon Mar 01, 2010 12:38 pm
by Kurby
Your date field may be in the wrong format. Can you give an example of your CSV and table format?

Re: Importing Data to sql database from excel

Posted: Mon Mar 01, 2010 1:12 pm
by dave.hawksworth
Thanks you were right although I thought I had checked several times The xl sheet was dd-Jan-yyyy, and the db table was yyyy-mm-dd. A bit sloppy on my part.
Dave :D

Re: Importing Data to sql database from excel

Posted: Fri Jun 11, 2010 4:56 pm
by rd.dcse
Please send me the code for importing file to mysql i will be thankfull to you rd.dcse@gmail.com

Thanks in advance

Re: Importing Data to sql database from excel

Posted: Sat Jun 12, 2010 4:42 pm
by internet-solution
rd.dcse wrote:Please send me the code for importing file to mysql i will be thankfull to you rd.dcse@gmail.com

Thanks in advance
OP is using PhpMyAdmin import for importing CSV file into MySQL.