I am trying to convert an access datetime field to a mysdl format, using the following string:
select str_to_date('04/03/1974 12:21:22', '%Y %m %d %T');
While I do not get an error, I do not get the expected result, instead I get this:
+---------------------------------------------------+ | str_to_date('04/03/1974 12:21:22', '%Y %m %d %T') | +---------------------------------------------------+ | NULL | +---------------------------------------------------+ 1 row in set, 1 warning (0.01 sec)
The access dates are in this format:
06.10.2008 14:19:08
I am not sure what I am missing.
As a side question, I am wondering if it is possible when importing a csv file to change the data in a column before? I want to replace the insert_date and update_date fields with my own dates, and I am not sure if it would be easier to do this before importing or after.
Many thanks for assistance.
Your syntax for the function is off.
Try:
The second parameter is telling the function where the parts of the dates are located in your string.
For your access question: