Results 1 to 3 of 3
  1. #1
    behnam is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    72

    How to combine two table into one in access.


    HI everyone, i have three tables created called cycle1, cycle2 and cycle. I want to union cycle1 and cycle2 and put the results into cycle. All the tables have the same fields. I wrote the query

    Code:
    SELECT * FROM cycle1 UNION ALL SELECT * FROM cycle2;
    but am not sure how to put the results in cycle. Thanks.

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Select queries only display the results. To add data to table use append query. You may use this union query to append the data to your cycle table

  3. #3
    drexasaurus's Avatar
    drexasaurus is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Santa Ana, CA
    Posts
    60
    You could save that query and use an insert statement to move the contents of that union into the other table, or you could combine the expression, something like

    INSERT INTO Cycle(col1, col2)
    SELECT
    col1, col2
    FROM
    (SELECT col1, col2 FROM cycle1
    UNION ALL
    SELECT col1, col2 FROM cycle2) AS UnionQry

    That would work (tested a sample because Access syntax throws me off a little sometimes). You wouldn't necessarily need to reference the columns, though it's good practice. If you are going to be writing your own DML scripts and queries, it would be a good idea to start reading up on them too.

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

Similar Threads

  1. Combine data from one table
    By Ray67 in forum Queries
    Replies: 19
    Last Post: 08-04-2014, 07:12 AM
  2. Combine Two Records into One from One Table
    By darcien in forum Queries
    Replies: 3
    Last Post: 10-10-2012, 09:17 AM
  3. Combine records in a table
    By smoothlarryhughes in forum Queries
    Replies: 3
    Last Post: 09-14-2012, 08:14 PM
  4. Combine table and form view
    By accessnewb in forum Access
    Replies: 1
    Last Post: 08-14-2011, 12:35 PM
  5. Combine Query Results to One Table
    By pr4t3ek in forum Queries
    Replies: 0
    Last Post: 12-19-2008, 06:37 AM

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