A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

UNION ALL Query



 
 
Thread Tools Display Modes
  #1  
Old July 31st, 2004, 01:38 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 01:59 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 01:59 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 01:59 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:33 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:33 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:33 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:42 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:42 AM
Brook
external usenet poster
 
Posts: n/a
Default 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  
Old July 31st, 2004, 06:42 AM
Brook
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 10:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.