Excel’s datetime values look like 42291.60493, which means MySQL sees them as strings and not as dates. Is there a MySQL code that can convert them to MySQL datetime? (i.e. like in MS SQL)
Advertisement
Answer
I can think of 2 solutions:
Convert your dates within excel to a formatted date string that conforms to mysql’s date and time format using text() function within excel.
Convert the number using calculation to date within mysql:
(the expression below may be simplified)
select date_add(date_add(date('1899-12-31'), interval floor(@datefromexcel) day), interval floor(86400*(@datefromexcel-floor(@datefromexcel))) second)