If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
UNION ALL Query
To All:
I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook |
#2
|
|||
|
|||
UNION ALL Query
Assuming that the table already exists where you'll put the records...
First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook |
#3
|
|||
|
|||
UNION ALL Query
Assuming that the table already exists where you'll put the records...
First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook |
#4
|
|||
|
|||
UNION ALL Query
Assuming that the table already exists where you'll put the records...
First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook |
#5
|
|||
|
|||
UNION ALL Query
Thanks for the information, I am still a little confused
about something: Where do I put the following code in my query? SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; BRook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
#6
|
|||
|
|||
UNION ALL Query
Thanks for the information, I am still a little confused
about something: Where do I put the following code in my query? SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; BRook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
#7
|
|||
|
|||
UNION ALL Query
Thanks for the information, I am still a little confused
about something: Where do I put the following code in my query? SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; BRook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
#8
|
|||
|
|||
UNION ALL Query
OK, I was able to get the UNION QUERY to function
properly, except that when My tables merged, my ORDER ID fileds for both didn't copy over correctly. for my ORDERID on my tblStockOrders (Autonumber using a format setup "NW- "0000) and tblCustomOrders (Autonumber using a format setup "KI-"0000). What is copies over is this: If I had a ORDERID of KI-0004, it copies the 4 over as the order ID. Any suggestions on how to copy the full ID over? Brook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
#9
|
|||
|
|||
UNION ALL Query
OK, I was able to get the UNION QUERY to function
properly, except that when My tables merged, my ORDER ID fileds for both didn't copy over correctly. for my ORDERID on my tblStockOrders (Autonumber using a format setup "NW- "0000) and tblCustomOrders (Autonumber using a format setup "KI-"0000). What is copies over is this: If I had a ORDERID of KI-0004, it copies the 4 over as the order ID. Any suggestions on how to copy the full ID over? Brook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
#10
|
|||
|
|||
UNION ALL Query
OK, I was able to get the UNION QUERY to function
properly, except that when My tables merged, my ORDER ID fileds for both didn't copy over correctly. for my ORDERID on my tblStockOrders (Autonumber using a format setup "NW- "0000) and tblCustomOrders (Autonumber using a format setup "KI-"0000). What is copies over is this: If I had a ORDERID of KI-0004, it copies the 4 over as the order ID. Any suggestions on how to copy the full ID over? Brook -----Original Message----- Assuming that the table already exists where you'll put the records... First, create and save the Union Query (following assumes that each table has the same number of fields and that each corresponding field pair has same format): SELECT tblCustomOrders.* FROM tblCustomOrders UNION ALL SELECT tblStockOrders.* FROM tblStockOrders; Save this query using the name UnionQry. Then use this append query to copy the results into your target table: INSERT INTO TargetTable SELECT UnionQry.* FROM UnionQry; -- Ken Snell MS ACCESS MVP "Brook" wrote in message ... To All: I am trying to joing two tables with the same data fields using the UNION All query. My two tables are tblCustomOrders and tblStockOrders and I would like to combine them into one table. Can anyone give me any tips on how to do this using the Union Query? Thanks Brook . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"UNION" Query with different fields in the two tables | Dkline | Running & Setting Up Queries | 5 | July 30th, 2004 09:05 PM |
UNION query question | Dale Peart | Running & Setting Up Queries | 6 | July 14th, 2004 12:26 AM |
Union Query Issue | Larry | Running & Setting Up Queries | 4 | July 12th, 2004 08:53 AM |
UNION Query truncating Memo fields | Matthew DeAngelis | Running & Setting Up Queries | 4 | June 10th, 2004 02:17 PM |
Edit table using union query | De'Ville | Running & Setting Up Queries | 1 | June 1st, 2004 11:46 AM |