Results 1 to 4 of 4
  1. #1
    stemar805 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    3

    Query input must contain at least one table or query

    Good Morning to all,

    I apologize for the bother... I've never used a forum like this, so I do apologize if I'm breaking any rules....

    I'm trying to simulate a union all query... I've created an inner join query, a left join query and a right join query, to then perform a union all. I put filters in the left and right joins to show me only the null values of a field that belongs to the other. Can anyone tell me why I'm getting this error?

    SELECT [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].START_TIME, [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].END_TIME, [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].CHARGES, [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].EXPENSES, [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].GOC, [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY CHARGES], [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY EXPENSES], [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY CHARGES], [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY EXPENSES], [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].[PMF ACCOUNT], [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario].Scenario, [InnerJoin - Expenses and Charges per GOC
    FROM [InnerJoin - Expenses and Charges per GOC, PMF Account, Scenario]
    union all
    SELECT [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[Start Time], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].END_TIME, [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].CHARGES, [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].EXPENSES, [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].Goc, [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY CHARGES], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY EXPENSES], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY CHARGES], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY EXPENSES], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].[PMF ACCOUNT], [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario].Scenario


    FROM [LeftJoin - Expenses and Charges per GOC, PMF Account, Scenario]
    union all
    SELECT [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].START_TIME, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].END_TIME, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].CHARGES, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].EXPENSES, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].Goc, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY CHARGES], [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MAJOR CATEGORY EXPENSES], [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY CHARGES], [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].[MINOR CATEGORY EXPENSES], [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].LVL_18_ACCOUNT, [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].Scenario
    FROM [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario];

  2. #2
    stemar805 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    3
    I've updated "[RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].LVL_18_ACCOUNT" so that it reads [RightJoin - Expenses and Charges per GOC, PMF Account, Scenario].[PMF ACCOUNT]. Now all the field names are matching... but am still getting the same error. Can anyone tell me what I'm doing wrong?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    This line from the first SELECT looks incomplete:

    [InnerJoin - Expenses and Charges per GOC
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    stemar805 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    3
    Thank you very much... as you can tell, I'm not the brightest light in the office .... something so simple.... feel so dumb... Thank you very much for your help!!!!

    Quote Originally Posted by June7 View Post
    This line from the first SELECT looks incomplete:

    [InnerJoin - Expenses and Charges per GOC

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-12-2011, 08:07 AM
  2. Replies: 2
    Last Post: 05-27-2011, 05:55 AM
  3. Replies: 10
    Last Post: 02-02-2011, 05:48 PM
  4. Table Values As Query Input?
    By joolio in forum Access
    Replies: 2
    Last Post: 01-05-2010, 07:32 AM
  5. Replies: 0
    Last Post: 12-21-2009, 12:15 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums