MySQL Forums
Forum List  »  Newbie

Re: LOAD DATA INFILE date format hell
Posted by: Felix Geerinckx
Date: January 24, 2007 11:41AM

Gary Thomas Wrote:

> SET Date = date_format(str_to_date(@date, '%d/%m/%y'), '%Y/%m/%d');
>
> 24/01/07 is how it is on the csv but mysql need 2007/01/24

Incorrect: MySQL needs '2007-01-24', not '2007/01/24'.
There is no need to use DATE_FORMAT(), since STR_TO_DATE() already returns a DATE in the correct format.

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: LOAD DATA INFILE date format hell
January 24, 2007 11:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.