Hi,

thanks for your answer. You never have problems since youalways use the date format in 
the standard way, no european exception ;-)

mmhhh... It's hard to make the company administering the original data base change the 
export format. So I'll have to import dates as strings and somehow convert dates 
(change the order of day, month and year as well as the delimiter).

Any Tip's welcome.

Best Regards
Bernhard

----- Original Message ----- 
From: "--==[bMan]==--" <[EMAIL PROTECTED]>
To: "Bernhard Doebler" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, July 05, 2001 12:23 PM
Subject: Re: LOAD DATA INFILE


> 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:
> 
> > 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?
> >


---------------------------------------------------------------------
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