Two tables are involved:
tblDonations: holds all donations.
tblDtDesignation: holds all designations (allow multiple designations) for all donations.
When individuals are grouped in one donation, each group member gets their own donation record in the tblDonations table.
field: donationAmt - set to zero for all group members except the Main donor in the group.
field: GroupID - relate group members to each other.
field: GroupAmt - the amount each contributes.
In the Designations table:
field: dtdesignation_FdonationID - the foreign key linking to the Donations table. For grouped donations, designations are only recorded for the Main donationID. So no designations in the Designations table have a foreign key relating to a non-Main group donation.
So, when I print receipts, I need a query that displays all the designations in the designation table, plus the missing ones for the group members. Their designation(s) is/are the same as the designation(s) for the Main donationID in their group.
I just can't wrap my brain around the SQL that would be involved. I sure hope someone out there derives pleasure out of solving this type of problem; it just makes me dizzy. Any attempt much appreciated. If I didn't explain it well, please let me know.
Daniel Dillon
o (<--- brain shown at actual size.)
tblDonations: holds all donations.
tblDtDesignation: holds all designations (allow multiple designations) for all donations.
When individuals are grouped in one donation, each group member gets their own donation record in the tblDonations table.
field: donationAmt - set to zero for all group members except the Main donor in the group.
field: GroupID - relate group members to each other.
field: GroupAmt - the amount each contributes.
In the Designations table:
field: dtdesignation_FdonationID - the foreign key linking to the Donations table. For grouped donations, designations are only recorded for the Main donationID. So no designations in the Designations table have a foreign key relating to a non-Main group donation.
So, when I print receipts, I need a query that displays all the designations in the designation table, plus the missing ones for the group members. Their designation(s) is/are the same as the designation(s) for the Main donationID in their group.
I just can't wrap my brain around the SQL that would be involved. I sure hope someone out there derives pleasure out of solving this type of problem; it just makes me dizzy. Any attempt much appreciated. If I didn't explain it well, please let me know.
Daniel Dillon
o (<--- brain shown at actual size.)