Article ID: 141284 - View products that this article applies to.
This article was previously published under Q141284
When you use a Microsoft Excel worksheet as a data source in Microsoft Query, and you attempt to create a join between two fields of seemingly similar data types, Microsoft Query may generate the following warning message:
If you choose Yes to this option, you receive either of the following errors:
Columns <name> and <name> that you are about to join are of different types. Create the join anyway?
Microsoft Query version 1.0
Microsoft Query version 2.0
Reserved error(-3079); there is no message for this error.
Microsoft Query version 8.0
This behavior occurs regardless of the number of "Rows To Scan" you specified when you set up the data source.
Type mismatch in JOIN expression.
This problem occurs because the two apparently similar fields may be evaluated as being of different data types. This difference in type causes an error and prevents you from completing the join.
The Microsoft Excel Open Database Connectivity (ODBC) driver provides an option called Rows To Scan. This option specifies the number of rows to scan to determine the data type of each column. The data type is determined given the maximum number of kinds of data found. If data is encountered that does not match the data type guessed for the column, the data type will be returned as a NULL value. The ODBC.HLP file included with the ODBC driver includes the following information:
For the Microsoft Excel driver, you may enter a number from 1 to 16 for the rows to scan; however, the value will always default to 1. (A number outside the limit will return an error.)This information is incorrect. The Rows To Scan option will always use the first eight rows of data to determine the data type of a given field regardless of the number of rows specified. In the case where the first 8 rows contain four numeric and four text values, the data type for the column will default to Number.
To ensure that Microsoft Query accesses your Microsoft Excel data properly, make sure that all values in a particular column are of the same data type. Do not mix text and numeric data in a single column. If you need to have mixed data in a field, format the column in Microsoft Excel as Text (on the Format menu, click Cells, and select the Text option on the Numbers tab) before you enter data.
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
For more information about Rows To Scan, click Help in the Add Data Source dialog box. In ODBC Help, click the Index tab, and type the following text:
rows to scan
Article ID: 141284 - Last Review: August 19, 2003 - Revision: 1.1
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.