PRB: "Data Type Mismatch" with Linked Tables in Query
Article ID: 147880
Article Last Modified on 9/30/2003
APPLIES TO
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft Visual FoxPro 3.0b Standard Edition
This article was previously published under Q147880
SYMPTOMS
One 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.
CAUSE
The joining fields in the two tables are not of the same data type.
STATUS
This 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.
Additional query words: VFoxWin
Keywords: KB147880