多个加入Access无法正常工作

时间:2018-05-21 09:56:04

标签: ms-access outer-join

我有几张桌子正在连接。但是它现在抛出了一条错误信息 -

  

不支持JOIN表达式。

我认为它与括号的数量有关,但我已经仔细检查过,似乎没问题。

Select
T1.ASSR_FEE as AssessorFee,
T1.CAU_DT as Comment,
T1.Incident_Date as IncidentDate,
T1.Inv_amount as InvoiceAmount,
T1.Rep_Cost as RepCost,
T1.cl_id_ecm as ReferenceId,
t1.Est_cost_init as EstimatedCost,
t6.name as Location,
T2.CO_Name & ' ' & T2.Surname as DriverName,
T3.CO_Name & ' ' & T3.Surname as InspectorName,
T7.Full_Desc as Customer,
T8.Full_Desc as CollectionPoint,
T9.Full_Desc as MainDescription,
T10.Full_Desc as Subdescription  
FROM
    ((((((((cl_details T1)
    LEFT OUTER JOIN [C:\Users\cjack\Desktop\Test Stuff\ecm_hol.mdb].tb_pers T2 on T1.pers_no = T2.ref_id)
    LEFT OUTER JOIN [C:\Users\cjack\Desktop\Test Stuff\ecm_hol.mdb].tb_pers T3 on T1.insp_id = T3.ref_id)
    LEFT OUTER JOIN cl_coding T4 on T1.cl_id = T4.cl_id)
    Left outer join Dealers T6 on T1.cldeta_dealer0 = T6.dealer0)
    Left Outer Join Sy_code_list T7 on t4.ID_Code = t7.ID_Code and t4.Level_2 = t7.Level_2 and t7.ID_Code = 2 and (t7.Level_3 = 0 or t7.Level_3 = -1))
    Left Outer Join Sy_code_list T8 on t4.ID_Code = t8.ID_Code and t4.Level_2 = t8.Level_2 and t8.ID_Code = 11 and (t8.Level_3 = 0 or t8.Level_3 = -1))
    Left Outer Join Sy_code_list T9 on t4.ID_Code = t9.ID_Code and t4.Level_2  = t9.Level_2 and t9.ID_Code = 5 and (t9.Level_3 = 0 or t9.Level_3 = -1))
    Left Outer Join Sy_code_list T10 on t4.ID_Code = t10.ID_Code and t4.Level_2 = t10.Level_2 and t4.Level_3 = t10.Level_3 and t10.ID_Code = 5 and (t10.Level_4 = 0 or t10.Level_4 = -1)

任何帮助表示感谢。

由于

1 个答案:

答案 0 :(得分:1)

必须添加括号

Select
T1.ASSR_FEE as AssessorFee,
T1.CAU_DT as Comment,
T1.Incident_Date as IncidentDate,
T1.Inv_amount as InvoiceAmount,
T1.Rep_Cost as RepCost,
T1.cl_id_ecm as ReferenceId,
t1.Est_cost_init as EstimatedCost,
t6.name as Location,
T2.CO_Name & ' ' & T2.Surname as DriverName,
T3.CO_Name & ' ' & T3.Surname as InspectorName,
T7.Full_Desc as Customer,
T8.Full_Desc as CollectionPoint,
T9.Full_Desc as MainDescription,
T10.Full_Desc as Subdescription  
FROM
((((((((cl_details T1)
LEFT OUTER JOIN [C:\Users\cjack\Desktop\Test Stuff\ecm_hol.mdb].tb_pers T2 on (T1.pers_no = T2.ref_id))
LEFT OUTER JOIN [C:\Users\cjack\Desktop\Test Stuff\ecm_hol.mdb].tb_pers T3 on (T1.insp_id = T3.ref_id))
LEFT OUTER JOIN cl_coding T4 on (T1.cl_id = T4.cl_id))
Left outer join Dealers T6 on (T1.cldeta_dealer0 = T6.dealer0))
Left Outer Join Sy_code_list T7 on (t4.ID_Code = t7.ID_Code and t4.Level_2 = t7.Level_2 and t7.ID_Code = 2 and (t7.Level_3 = 0 or t7.Level_3 = -1)))
Left Outer Join Sy_code_list T8 on (t4.ID_Code = t8.ID_Code and t4.Level_2 = t8.Level_2 and t8.ID_Code = 11 and (t8.Level_3 = 0 or t8.Level_3 = -1)))
Left Outer Join Sy_code_list T9 on (t4.ID_Code = t9.ID_Code and t4.Level_2  = t9.Level_2 and t9.ID_Code = 5 and (t9.Level_3 = 0 or t9.Level_3 = -1)))
Left Outer Join Sy_code_list T10 on (t4.ID_Code = t10.ID_Code and t4.Level_2 = t10.Level_2 and t4.Level_3 = t10.Level_3 and t10.ID_Code = 5 and (t10.Level_4 = 0 or t10.Level_4 = -1))