Relationship Question

doucecool57

New Member
Joined
Mar 20, 2013
Messages
8
I have a database with a table containing PK Autonumber with information on the different staff at my company. I have another table that holds data on "incidents" that have occured. I need to build relationships between my staff and the "incident" table but have multiple fields in the incident table that need to be associated with staff.....Initiating Staff, Involved Staff, Report Writer (All fields are to be populated using my "staff" table). I guess I'm having trouble properly building this relationship.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
For many to many you can use a linking table:
---------------------------------------
| IncidentID | StaffID | Category     |
---------------------------------------
|          1 |      10 | Initiating   |
|          1 |      11 | Involved     |
|          1 |      12 | Involved     |
|          2 |      10 | Initiating   |
|          2 |      12 | Involved     |
|          3 |      10 | Initiating   |
|          3 |      11 | Involved     |
|          3 |      14 | Involved     |
|          4 |      11 | Initiating   |
|          5 |      14 | Initiating   |
|          5 |      14 | ReportWriter |
---------------------------------------


The table is linked to Incidents on IncidentID (one to many) and it is also linked to staff on StaffID (one to many). The table has a composite Foreign Key of all three fields: IncidentID-StaffID-Category. You will have to use this table in your joins but if you set it up in relationships with the proper relationships it is usually quite quick to construct your queries in the query by example grid.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top