问题描述
这是我现在的SQL代码,我可以做什么来解决它,因为当我尝试运行它说:在表达式中键入Mismatch
This is the SQL code I have at the moment, what can I do to fix it because when I try to run it it says Type Mismatch in expression
SELECT tblCustomers.CustomerID, tblCustomers.Lastname, tblCustomers.Firstname,
tblCustomers.AddressLine1, tblCustomers.Phone, tblOrders.OrderID,
tblOrders.CustomerID, tblOrders.NumberOfCDs, tblOrders.OrderDate,
tblOrders.PaymentType, tblOrders.AmountPaid, tblOrders.Discount, tblOrders.OrderSent
FROM tblCustomers
INNER JOIN tblOrders ON tblCustomers.CustomerID = tblOrders.CustomerID;
PS:我刚刚开始学习使用访问权限,因此原谅我的Noobyness更好的词。
P.S: I have just started to learn to use access so forgive my 'Noobyness' for lack of a better word.
推荐答案
您不能将苹果与橘子进行比较。
You can't compare apples to oranges.
这意味着,当你比较两件事时,他们需要是相同的类型。
Meaning, when you compare 2 things, they need to be of the samee type.
c $ c> tblCustomers.CustomerID = tblOrders.CustomerID 您比较2件事 - 确保它们具有相同的类型。
Here tblCustomers.CustomerID = tblOrders.CustomerID
you compare 2 things - make sure that they have the same type.
阅读 ,获取两个表的数据库模式,并比较 CustomerID
。
Read this , get db schema for both table and compare CustomerID
on both.
这篇关于需要帮助在访问多表查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!