2

3つの結合を含む必要があるクエリがありますが、次のエラーが発生します。

構文エラー(演算子がありません)

SQL:

SELECT
    Agents.[PF],
    Agents.[User_ID],
    Agents.[First_Name],
    Agents.[Second_Name],
    Agents.[Third_Name],
    Agents.[Family_Name],
    Agents.[Gender],
    Agents.[Contract_Type],
    Agents.Area,
    Teams.Team_Name,
    Agents.Hiring_Date,
    Resignation_Pool.Resignation_Date,
    Resignation_Pool.Effective_Date,
    Replace(
          IIf(Skills.Skill_Directory IS NULL, '', 'Directory, ')
        + IIf(Skills.Skill_TRC IS NULL, '', 'TRC, ')
        + IIf(Skills.Skill_Prepaid IS NULL, '', 'Prepaid, ')
        + IIf(Skills.Skill_Postpaid IS NULL, '', 'Postpaid, ')
        + IIf(Skills.Skill_KeyAccount IS NULL, '', 'KeyAccount, ')
        + IIf(Skills.Skill_Blackberry IS NULL, '', 'Blackberry, ')
        + IIf(Skills.Skill_Broadband IS NULL, '', 'Broadband, ')
        + IIf(Skills.Skill_Concierge IS NULL, '', 'Concierge, ')
        + IIf(Skills.Skill_ISP IS NULL, '', 'ISP, ')
        + IIf(Skills.Skill_Mada IS NULL, '', 'Mada, ')
        + IIf(Skills.Skill_CSCS IS NULL, '', 'CSCS, ')
        + '$', ', $', ''
    ) AS Skills
FROM Agents
LEFT JOIN Resignation_Pool
    ON Agents.PF = Resignation_Pool.PF
LEFT JOIN Teams
    ON Agents.Team = Teams.ID
LEFT JOIN Skills
    ON Agents.PF = Skills.PF
WHERE Agents.Contract_Status = 'Active'

このエラーの原因は何ですか?

4

1 に答える 1

5

MS AccessではJOIN、複数のテーブルを持つ構文を括弧で囲む必要があります。次のようなものを使用する必要があります。

FROM ((Agents
LEFT JOIN Resignation_Pool
    ON Agents.PF = Resignation_Pool.PF)
LEFT JOIN Teams
    ON Agents.Team = Teams.ID)
LEFT JOIN Skills
    ON Agents.PF = Skills.PF
于 2013-03-10T20:11:22.983 に答える