One to Many - Help

kbreiss

Registered User.
Local time
Today, 15:12
Joined
Oct 1, 2002
Messages
228
I have two tables..."Contact" & "Events". I can have many contacts per Event. I want to write a query that lists everything in the "Events" table, but instead of using the Contact_IDs use the Contact's name corresponding to his own Contact_ID. Please help with me writting this query...I've attached the query layout as a Word document. Thanks in advance.

Kacy
________
BUY BUBBLERS
 

Attachments

Last edited:
It looks as though you have too many relationships there. You should only need one relationship to link the tables together unless I am missing something. You can include Contact_ID in the table, and uncheck the output box to keep it from displaying in the query. That way, you'll just display the name. To display everything in the events table, just drag the * down from the Table box into the query.
 
There can be many contacts in one event. That is why I have them all linked. So:
Event_RoR_Contact
Event_RoR_Contact2
Event_MDU_Contact
Event_MDU_Contact2
Event_Vision_Contact
Event_Vision_Contact2
....is all linked to the Contact_ID. They are all different contacts. Hopefully this makes since....Thanks for the help.

Kacy
________
Silver surfer review
 
Last edited:
The relationships look so strange because your table is not normalized. You need a third table with the data that repeats. You should end up with only a single relationship with the contact table if you do it right.

As your structure is now, you would need to include the contact table NINE times in your query. Once for each of the relationships. Be sure to use Left Joins or nulls in the many-side table will prevent events from showing.
 
Thanks Pat,
I understand about adding the "Contact" table nine times...I'm unsure on what you mean by adding a 3rd table with the data that repeats...Would you clarify please...I want to do things the right way....Thanks.

Kacy
________
Rare Disorders Advice
 
Last edited:

Users who are viewing this thread

Back
Top Bottom