I am using Spreadsheet::ParseExcel to read data from an excel spreadsheet. I have encountered a problem ingesting dates. The excel date format is mm/dd/yyyy whereas mysql expects yyyy-mm-dd. I tried reformating the cells in the spreadsheet and I can, in fact, format the presentation of the date to match the yyyy-mm-dd format that mysql expects, but when I select a cell it turns out the cell content is still in the mm/dd/yyyy format. Therefore, when attempt to insert the dates into mysql I only get 0000-00-00.
I am attempting to use the STR_TO_DATE mysql function within my DBI do statement to correct this problem. My code looks like this:
$dbh->do("insert into frame
However, this date formatting syntax is failing:
DBD::mysql::db do failed: You have an error in your SQL syntax; check
+the manual that corresponds to your MySQL server version for the righ
+t syntax to use near '' at line 3 at ./excel.syr.frame.extract.pl lin
I imagine this is a common problem for which there is a common answer, but I am having trouble finding it on the mysql or perl sites/reference material I have searched.