SELECT
tbl_vehicle_models.model_name AS Vehicle_Model,
tbl_vehicle_models.manufacturer AS Manufacturer,
tbl_jobs.vehicle_registration_number AS Registration_Number,
tbl_customers.first_name + " " + tbl_customers.last_name AS Customer_Name,
tbl_customers.address AS Address,
tbl_customers.contact_no AS Contact_Number,
tbl_jobs.cost_charged AS Cost,
tbl_jobs.was_accident AS Was_Accident,
tbl_jobs.was_towed AS Was_Towed,
tbl_jobs.job_call_time AS Call_Time,
tbl_jobs.job_arrival_time AS Arrival_Time,
tbl_jobs.job_leaving_scene_time AS Leaving_Time,
tbl_places.place_name AS Place
FROM
tbl_jobs
INNER JOIN tbl_vehicle_models
ON ( tbl_vehicle_models.ID = tbl_jobs.vehicle_model )
INNER JOIN tbl_customers
ON ( tbl_customers.ID = tbl_jobs.customer_id )
INNER JOIN tbl_places
ON ( tbl_places.ID = tbl_jobs.job_place )
此查询有什么问题?我收到错误说在查询表达式中缺少运算符'(v.ID = j.vehicle_model) INNER JOIN tbl_customers c ON(c.id = j.customer_id) INNER JOIN tbl_places p ON(p.ID = j.job_place'
编辑:这解决了我的问题:
SELECT tbl_vehicle_models.model_name, tbl_vehicle_models.manufacturer, tbl_jobs.vehicle_registration_number, tbl_customers.first_name & " " & tbl_customers.last_name AS Expr1, tbl_customers.address, tbl_customers.contact_no, tbl_jobs.cost_charged, tbl_jobs.was_accident, tbl_jobs.was_towed, tbl_jobs.job_call_time, tbl_jobs.job_arrival_time, tbl_jobs.job_leaving_scene_time, tbl_places.place_name
FROM ((tbl_jobs INNER JOIN tbl_vehicle_models ON tbl_jobs.vehicle_model = tbl_vehicle_models.ID) INNER JOIN tbl_customers ON tbl_jobs.customer_id = tbl_customers.ID) INNER JOIN tbl_places ON tbl_jobs.job_place = tbl_places.ID;
答案 0 :(得分:0)
您确定v.ID
和j.vehicle_model
具有相同的数据类型吗?
看起来v.ID
是一个整数,j.vehicle_model
是一个字符串
我认为当您尝试使用具有不兼容的操作数数据类型的运算符时会发生此问题。
编辑: 然后,尝试更改
c.first_name + " " + c.last_name
到
c.first_name & " " & c.last_name
我认为这是串联的问题
答案 1 :(得分:0)
这解决了我的问题:
SELECT tbl_vehicle_models.model_name, tbl_vehicle_models.manufacturer,
tbl_jobs.vehicle_registration_number, tbl_customers.first_name & " " &
tbl_customers.last_name AS Expr1, tbl_customers.address, tbl_customers.contact_no,
tbl_jobs.cost_charged, tbl_jobs.was_accident, tbl_jobs.was_towed, tbl_jobs.job_call_time,
tbl_jobs.job_arrival_time, tbl_jobs.job_leaving_scene_time, tbl_places.place_name
FROM ((tbl_jobs
INNER JOIN tbl_vehicle_models ON tbl_jobs.vehicle_model = tbl_vehicle_models.ID)
INNER JOIN tbl_customers ON tbl_jobs.customer_id = tbl_customers.ID)
INNER JOIN tbl_places ON tbl_jobs.job_place = tbl_places.ID;