Friday, April 15, 2011

Data type mismatch in criteria expression in Excel File Search in OLEDB conection

when i try to use a where cause to filter empty rows in Excel file query

if the column data type is string, then i can use [ColumnName] <>' ' to filter all empty rows.

however the column fill with numeric value, then you will receive this error message "Data type mismatch in criteria expression"

the trick to solve this issue is that you can use Is Not NULL to filter all empty rows when the excel file is read.

Here is the sample Query

Select [Column1],[Column2],[Column3],[Column4],[Column5],[Column6] from [Table$] where [Column1] is Not NULL

No comments:

Post a Comment