I am running SQL select queries against data in an Excel sheet. These queries have WHERE clauses. When I run a query with a WHERE clause on a numeric column I get a Data Type Mismatch error when the first record in the data set has a null value in the WHERE clause column.
For example, assume the following: SELECT @ FROM [Data$] WHERE [Year] = 2015. If the first record has a blank in the Year column then Excel returns the error. If I put any number in the first record in the Year column (e.g., 0) then the query runs fine.
Any ideas on how to avoid this error?
Bookmarks