mycompetitionti
7 years agoQrew Member
How to add multiple records to one table from fields in 2 tables, whenever either changes, that can only be joined by non key fields
i am having some difficulty figuring out how to do this. I would like to add multiple records to a table we will call table 3 , when a record is added or modified in a table we will call table 1 , where table 3 record needs fields from both table 1 and a table we will call table 2 . The problem is table 1 and 2 can only be related via a non key field.
table 1 - is an eventClassParticipant table
table 2 - is a CategoryClass association table, where a class can be associated with more than one category
table 3 - is a CategoryEventClassParticipant table. It is a child of eventClassParticipant. It may have multiple records for each eventClassParticipant , based on if the Class that the participant is in is associated with more than one category in CategoryClass
if we have these records in table1 eventClassParticipant:
eventid 1, classid 1, participantid 1
eventid 2, classid 1, participantid 2
and these in CategoryClass
categoryid 1, classid 1
categoryid 2, classid 1
then we want to get these records in CategoryEventClassParticipant
categoryid 1, classid 1, participantid 1
categoryid 2, classid 1, participantid 1
categoryid 1, classid 1, participantid 2
categoryid 2, classid 1, participantid 2
the reason i am trying to do this is that i need to report from the CategoryEventClassParticipant perspective
Because table 1 and 2 can not be related via a key field, I can not pull the category information into the detail records I need to report on.
Any ideas are welcome for accomplishing the ability to report on the data from the CategoryEventClassParticipant level.
thanks,
Kirsten
table 1 - is an eventClassParticipant table
table 2 - is a CategoryClass association table, where a class can be associated with more than one category
table 3 - is a CategoryEventClassParticipant table. It is a child of eventClassParticipant. It may have multiple records for each eventClassParticipant , based on if the Class that the participant is in is associated with more than one category in CategoryClass
if we have these records in table1 eventClassParticipant:
eventid 1, classid 1, participantid 1
eventid 2, classid 1, participantid 2
and these in CategoryClass
categoryid 1, classid 1
categoryid 2, classid 1
then we want to get these records in CategoryEventClassParticipant
categoryid 1, classid 1, participantid 1
categoryid 2, classid 1, participantid 1
categoryid 1, classid 1, participantid 2
categoryid 2, classid 1, participantid 2
the reason i am trying to do this is that i need to report from the CategoryEventClassParticipant perspective
Because table 1 and 2 can not be related via a key field, I can not pull the category information into the detail records I need to report on.
Any ideas are welcome for accomplishing the ability to report on the data from the CategoryEventClassParticipant level.
thanks,
Kirsten