【问题标题】:Multi Join in Access not workingAccess中的多连接不起作用
【发布时间】:2018-10-30 23:00:05
【问题描述】:

我有几个要连接的表。但是它现在抛出一条错误消息 -

不支持 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)

任何帮助表示赞赏。

谢谢

【问题讨论】:

  • 似乎您必须将 on 语句括起来。现在工作

标签: ms-access outer-join


【解决方案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))

【讨论】:

    猜你喜欢
    • 2014-11-29
    • 1970-01-01
    • 2014-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-04
    相关资源
    最近更新 更多