I have a text file where a field is date/time; however, the date component is not exactly MM/DD/YYYY e.g. 7/5/2013 12:30:01 AM instead of 07/05/2013...
In the load statement, I first tried:
Set OffMarketDate= str_to_date(@OffMarketDate,'%m/%d/%Y');
But this gave Error 1292 Truncated incorrect date value: 7/5/2013 12:30:01 AM
Odd to me that this seems to work fine:
select str_to_date("7/5/2013 12:30:01 AM",'%m/%d/%Y');
Anyway, so I wanted to try something like
select left(str_to_date("7/5/2013 12:30:01 AM",'%m/%d/%Y'),10)
but the date will be somewhere between 8 and 10 characters, so hardcoding 10 is a problem.
Would appreciate some help resolving this