Home » excel » datetime – SSIS Excel Date empty in first rows not in last rows => date is always empty

datetime – SSIS Excel Date empty in first rows not in last rows => date is always empty

Posted by: admin May 14, 2020 Leave a comment

Questions:

I do a ssis package which I read an Excel file. I have a column with a date. If the first row the date is empty all lines are concidered empty, if I put a line with a date is ok.
The file is automacly genereted, not by me, so I can change the order of line. How I can force to have a date ??

I know in input the date is like a string (DT_WSTR) because it could be empty. So after I know how to convert it. So don’t explain me how convert it. I just want to know how to have the date when it’s on the line.

sorry for my english

Thx,

How to&Answers:

Try adding “IMEX=1;” at the end of your connection string. This will force the Excel file to be read in import mode, reading everything as a string (even when empty).

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ExcelFile.xls;Extended Properties="EXCEL 8.0;HDR=YES;IMEX=1";