Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pull data from 2 tables to make one?

Status
Not open for further replies.

silver3

MIS
Apr 20, 2005
1
US
How do I pull data from 2 tables to make one? I have info in the first table that I would like to relate to the second table, but all it does is show the titles without combing the data.
 
You should tell us how the tables are related. We don't know if your solution involves a typical join or a union query. None of us can see:
- your tables
- your relationships
- your data
- your attempted SQL view

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Silver

It may be helpful if you read some of the follwing...

Fundamentals of Relational Database Design (by Paul Litwin)
Download document
Read on-line (HTML)

Micro$oft's answer...
283878 - Description of the database normalization basics
304467 - ACC2000 Defining Relationships Between Tables in a Microsoft Access Database

More advanced topics with a superb, but brief overview...
Harnessing the Power of Updatable Queries

How do I pull data from 2 tables to make one
With a relational database, you want to avoid duplication of data. Duplicate data can lead to problems such as inaccuracies and a lot more work later on.

Normally, you create a "view" that shows the two tables together.

Suppose you want to track grocery shopping. How much you spent, what you bought and when.

Well, for each item purchased, you do not want to ask "When". The "when" would be asked once for the entire grocery trip.

tblGroceryTrip
GroceryTripID - primary key
ShoppingDate
StoreName

Each of the above, you only need to ask "once".
When did you shop and where did you go?

tblPurchases
PurchaseID - primary key
GroceryTripID - foreign key to tblGroceryTrip
ItemName - item purchased
ItemQuantity
ItemPurchaseAmount - currency

Each of the above, you need to ask for each item purchased.
What was purchased, how many and what did it cost?

The GroceryTripID is used to link the GroceryTrip to what items were purchased. You display the "view" for this by using an SQL SELECT statement.

Richard
 
First, both tables have to be related. Then, you just create a make table query. The query type icon on the toolbar is how u create a make table query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top