Duplication of query

A

AJRoad

I have two tables: Customer Orders: fields are Customer Number-autonumber,
First Name-text, Last Name-text, Price-currency, SKU-Number.

The other table is Products-SKU-number and Description is text.

I would like to create a query that has the First Name, Last Name, Price and
SKU fields from the Customer Orders table and the Description field from the
Products table. I don't want to show the SKU field in the query. Is there
anyway to do this without producing two queries?

Thanks for the help.
 
J

John Spencer

The SQL of such a query would look something like the following.
Replace my guesses as to the field and table names with the actual field
and table names.

SELECT C.[First Name], C.[Last Name], C.Price, P.Description
FROM [Customer Orders] as C INNER JOIN [Products-SKU-Number] as P
ON C.[SKU-Number] = P.[SKU-Number]

IF you are using the query grid, then you only need to show the fields
you want to see. You don't need to show all fields.

If you have a query that shows more fields than you want and cannot
figure out how to limit the fields, then post the SQL of that query.
(HINT: in design view. View: SQL from the menu)


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
M

Marshall Barton

AJRoad said:
I have two tables: Customer Orders: fields are Customer Number-autonumber,
First Name-text, Last Name-text, Price-currency, SKU-Number.

The other table is Products-SKU-number and Description is text.

I would like to create a query that has the First Name, Last Name, Price and
SKU fields from the Customer Orders table and the Description field from the
Products table. I don't want to show the SKU field in the query. Is there
anyway to do this without producing two queries?


Create a new query and add both tables. Drag the SKU field
from one table to the SKU field in the other table. Then
drag the desired fields down to the query's field list.
 

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