>From my experience, if you want to import data into a date field, you have to make 
>sure that the date format in your csv file conforms to a date format required by 
>MySQL.  This part is covered in MySQL documentation.   So, your 20.12.1999 date 
>should become 2001-12-20 and so on.

P.S.  Don't forget to specify "TERMINATED BY ','" while using LOAD DATA INFILE.  I use 
this feature VERY often and never had any trouble.. :-)

Bernhard Doebler wrote:

> Hi,
>
> I have a CSV-file exported from another database.
>
> It contains fields with dates and dates and times. A somplefied CSV-file version 
>looks like so.
>
> 20.12.1999;21.12.1999 03:35:27
>
> When I import it with LOAD DATA INFILE... and use fieldtypes "date" and "datetime" 
>it sadly does not work. It imports as many records as lines are given in the file to 
>import but each date is zero (NULL). Is there a possibility to import it that 
>"simple" way rather to import it as text in one table and export it using date 
>conversion-functions in another table?
>
> Best Regards
> Bernhard Dobler
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

--
Bolek,

URL: http://www.bolek.com
URL: http://slash.bolek.com
e-mail: [EMAIL PROTECTED]
ICQ: 4086197, Address: 402905326




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to