PRB: "Data Type Mismatch" with Linked Tables in QueryLast reviewed: March 6, 1996Article ID: Q147880 |
The information in this article applies to:
SYMPTOMSOne of the most common causes of the "Operator/Operand type mismatch" error when running a query is that the joining fields between the tables are of different data types. The field from each table that joins the tables for the query must have identical data types. The exception is when one field is numeric and the other is character. FoxPro will attempt to make the character field numeric by using the VAL() function. Of course this is only useful if the character field holds numbers only. If there are any other types of characters in the field that FoxPro uses the VAL() function on, the query result will contain no records.
CAUSEThe joining fields in the two tables are not of the same data type.
STATUSThis behavior is by design. Choosing the correct data type when joining tables for a query is a necessity if the correct information is to be retrieved.
MORE INFORMATIONWhen using the Query designer to join information from tables into a query, FoxPro will look for the first two fields that have the same name in both tables regardless of their data type. If there is no field in each table that matches, then the user has to select the joining fields. If two fields with different data types are chosen to join the tables, then the error will occur because FoxPro cannot match the data in the fields correctly.
Steps to Reproduce Behavior
|
Additional reference words: 3.00 3.00b VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |