Need helping making a multi table query in access

我只是一个虾纸丫 提交于 2019-12-12 01:24:33

问题


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;

P.S: I have just started to learn to use access so forgive my 'Noobyness' for lack of a better word.


回答1:


You can't compare apples to oranges.

Meaning, when you compare 2 things, they need to be of the samee type.

Here tblCustomers.CustomerID = tblOrders.CustomerID you compare 2 things - make sure that they have the same type.

Read this , get db schema for both table and compare CustomerID on both.



来源:https://stackoverflow.com/questions/24362572/need-helping-making-a-multi-table-query-in-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!