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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to Create Table & Relationship

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I have 3 tables, each containing a field named user with 10 user names. There are currently no relationships between the tables. (Ive never worked with relationships)

I want to be able to run a report/query on a user's name and get info from records in all 3 tables where that user is listed. Would I need to create a new table containing the user names, and then somehow relate it to the other user fields in the 3 tables?

Thanks.
 
Hi,

I would do as you said, have a table with all your users listed and a unique ID for each one. Then create "1 to Many" relationships between the field on this table and the associated field on the other 3 tables.

Go to Tools --> Relationships and then add all the tables to the workspace.

Drag from the Names table to the realted field on the other 3 tables and then click the Join Type button and choose the appropriate option (depending on how you have set out your tables)

Doing this means that you will get the unique ID numbers stored in the 3 tables instead of the names, however you can get around this by relating the 2 in your queries and pulling the Name field from the Names table instead of the field from one of the 3 data tables.

Regards

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top