Creating a table from 2 different queries

J

Jaz

I have 2 queries that provide the following information:

Query 1
Vendor ID
Ship Qty

Query 2
Vendor ID
RejectQty

Is there a way to run these 2 queries and make 1 table with the following
information?

Vendor ID Ship Qty Reject Qty


Thanks,
Jasper
 
D

Douglas J. Steele

Sure. Create a 3rd query that joins them together (as though they were
tables), and use that query.

The SQL would look something like:

SELECT Query1.VendorID, Query1.ShipQty, Query2.RejectQty
FROM Query1 INNER JOIN Query2
ON Query1.VendorID = Query2.VendorID
 
J

Jaz

Perfect!

One more question: If this 3rd query uses the other queries to run, does it
actually run the 2 queries first?

So if I make a change on any of the first 2 queries, will it affect the 3rd
query?

Thanks,
Jasper
 
D

Douglas J. Steele

Yes, if you make changes to either of the first 2 queries, those changes
will apply to the 3rd query as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top