Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Baltimore, MD, Maryland, USA
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using a Union Query to combine Tables (OFFICE 97)

    Hi Everyone:
    I had 5 tables that I wanted to merge into 1 to make it easier to query. So I attempted a union query:
    SELECT RCOARRTM_ANS.* INTO RCOARRTM_ALL
    FROM RCOARRTM_ANS
    union all
    SELECT RCOARRTM_CC3.* INTO RCOARRTM_ALL
    FROM RCOARRTM_CC3
    UNION ALL
    SELECT RCOARRTM_PNS.* INTO RCOARRTM_ALL
    FROM RCOARRTM_PNS
    UNION ALL
    SELECT RCOARRTM_HNS.* INTO RCOARRTM_ALL
    FROM RCOARRTM_HNS
    SELECT RCOARRTM_NHF.* INTO RCOARRTM_ALL
    FROM RCOARRTM_NHF

    I got the message: "AN ACTION QUERY CAN NOT BE USED AS A ROW SOURCE".
    What did I do wrong and how can I make it right,
    Thanks

  2. #2
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a Union Query to combine Tables (OFFICE 97)

    I don't know if this is the most elegant solution, but you can get where you want to go by removing all your INTO clauses (so this becomes just a UNION query). Then create a second MAKE TABLE query that references your UNION QUERY and your INTO table name; e.g., SELECT * INTO RCOARRTM_ALL FROM UnionQuery;

    Hope this helps.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Baltimore, MD, Maryland, USA
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a Union Query to combine Tables (OFFICE 97)

    Thank you. This will do fine.

Posting Permissions

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