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
.
|