Results 1 to 4 of 4

Thread: SQL Query in Access

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2004
    Posts
    48

    Exclamation SQL Query in Access

    I have this sql query:

    SELECT Sum(Fees_Paid.Student_Fee_Paid) AS SumOfStudent_Fee_Paid
    FROM Fees_Paid LEFT JOIN (Camp_Session_And_Date INNER JOIN Camp_Registration ON Camp_Session_And_Date.Camp_Session_ID = Camp_Registration.Camp_Session_ID) ON Fees_Paid.Payment_ID = Camp_Registration.Payment_ID
    WHERE (((Camp_Session_And_Date.Camp_Year)=[Year]))
    GROUP BY Camp_Session_And_Date.Camp_Year;

    It is telling me that I have ambigious joins and that I need to break it up into 2 select statements within the same query...I tried breaking it up but can't seem to get around all of the errors when I do. How can I break this up to where it will give me a errorless response.

    HELP!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL Query in Access

    Even though this is in Access VBA it would get a better response in the Database Forum.
    Probably just post a link to this thread so the responses will all be in one thread.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Query in Access

    LEFT JOIN TABLENAME ON (condition) is the syntax

    not...

    LEFT JOIN (condition)

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2004
    Posts
    48

    Talking Re: SQL Query in Access

    Can you rewrite that SQL statement to fit what you are saying...i'm not sure if I fully get the concept...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width