access query wont run.

Posted on 2012-08-24
Last Modified: 2012-08-24
Acces gives an error saying a field could refer to more than one table but they are all fully referenced i think so i cannot see why it fails:
q1uestions: [AbiCurrentcodes].[EngineTypediff]
i am trying to capture change events where the field enginetypediff has changed since last month.

SELECT QryClientDifferencesLogic.[abiCode], [AbiCurrentcodes].[EngineTypediff] AS CurrentT, [AbicodesPrevious].[EngineTypediff] AS PrevT, "2012-08" AS Expr1
FROM (QryClientDifferencesLogic LEFT JOIN AbicodesPrevious ON QryClientDifferencesLogic.abiCode = AbicodesPrevious.abiCode) LEFT JOIN Abicurrentcodes ON QryClientDifferencesLogic.abiCode = Abicurrentcodes.abiCode
WHERE (((QryClientDifferencesLogic.EngineTypediff)=-1));

Open in new window

Question by:PeterBaileyUk
    LVL 47

    Accepted Solution

    Take a look at qryClientDifferencesLogic and see if it has any duplicate field names.
    LVL 16

    Expert Comment

    Try referencing each field with its table in all occurances.
    Also put table names in brackets in all instances

    SELECT [QryClientDifferencesLogic].[abiCode], [AbiCurrentcodes].[EngineTypediff] AS CurrentT, [AbicodesPrevious].[EngineTypediff] AS PrevT, "2012-08" AS Expr1
    FROM (QryClientDifferencesLogic LEFT JOIN AbicodesPrevious ON [QryClientDifferencesLogic].[abiCode] = [AbicodesPrevious].[abiCode]) LEFT JOIN Abicurrentcodes ON [QryClientDifferencesLogic].[abiCode] = [Abicurrentcodes].[abiCode]
    WHERE ((([QryClientDifferencesLogic].[EngineTypediff])=-1));

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
    If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now