Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Unanswered: Save Union results into a table

    In MS Access VBA (DAO), I use the union query below to combine two tables. I want to store the results into a table. How can I do this? Thanks a lot.

    SELECT *
    FROM cc left JOIN loans ON loans.ID = cc.ID
    UNION
    SELECT *
    FROM cc right JOIN loans ON loans.ID = cc.ID
    where cc.ID is null;
    Last edited by kennyming; 07-23-08 at 03:50.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    INSERT INTO my_new_table (comma, separated, list, of, columns)
    SELECT comma
         , separated
         , list
         , of
         , columns
    FROM   table_1
    UNION
    SELECT comma
         , separated
         , list
         , of
         , columns
    FROM   table_2
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by kennyming
    In MS Access VBA (DAO), I use the union query below to combine two tables. I want to store the results into a table.
    why would you want to?
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    That's what I was going to ask.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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