C
CS
I am trying to discover average donations per participant at events we run.
Tables in the Query:
BasicContactT (Name, address, etc.)
EventT (Date, Time, Location, Type)
ParticipationT (Which Contact attended)
DonationT (Donation Collected Where/How/How Much)
EventTypeT (just a lookup for including a name in a report)
DB is structured this way because not all Contacts Participate, not all
Participants Donate, and not all Donations come through Events.
The DB works fine at present for showing me, via subform, total
participations and donations for each Contact, the major tracking use for
the DB.
Because we sometimes get Donations at Events in cash, and do not know who
provided it, I have handled this by creating a Contact called "Unknown
Donor" -- this ContactID shows up in the Donations Table, with a link to the
Event where it was gathered, but *not* in the Participant Table (because I
don't want to skew Participant stats).
I want to discover the average donations per participant for each event.
However, when I include the tables in the table,
This is my sql
SELECT EventT.EventDateStart, EventTypeT.EventTypeName,
Count([BasicContactT].[FirstName] & " " & [BasicContactT].[LastName]) AS
Expr1, Avg(DonationT.DonationAmnt) AS AvgOfDonationAmnt
FROM ((EventT INNER JOIN (BasicContactT INNER JOIN ParticipationT ON
BasicContactT.ContactID = ParticipationT.ContactID) ON EventT.EventID =
ParticipationT.EventID) INNER JOIN EventTypeT ON EventT.EventType =
EventTypeT.EventTypeID) LEFT JOIN DonationT ON ParticipationT.ParticipantID
= DonationT.ParticipantID
GROUP BY EventT.EventDateStart, EventTypeT.EventTypeName
ORDER BY EventT.EventDateStart;
I get an average, but it is skewed because the "Unknown Donor" contact does
not appear in the Participation Table and so, that donation is excluded (I
don't want Unknown Donor in the ParticipationT, it is only a value to
represent donations from sources at the event that we can't identify to a
specific participant). We know the donation came from someone at the event,
but not who.
Any help much appreciated. Thanks in advance.
Carol
Tables in the Query:
BasicContactT (Name, address, etc.)
EventT (Date, Time, Location, Type)
ParticipationT (Which Contact attended)
DonationT (Donation Collected Where/How/How Much)
EventTypeT (just a lookup for including a name in a report)
DB is structured this way because not all Contacts Participate, not all
Participants Donate, and not all Donations come through Events.
The DB works fine at present for showing me, via subform, total
participations and donations for each Contact, the major tracking use for
the DB.
Because we sometimes get Donations at Events in cash, and do not know who
provided it, I have handled this by creating a Contact called "Unknown
Donor" -- this ContactID shows up in the Donations Table, with a link to the
Event where it was gathered, but *not* in the Participant Table (because I
don't want to skew Participant stats).
I want to discover the average donations per participant for each event.
However, when I include the tables in the table,
This is my sql
SELECT EventT.EventDateStart, EventTypeT.EventTypeName,
Count([BasicContactT].[FirstName] & " " & [BasicContactT].[LastName]) AS
Expr1, Avg(DonationT.DonationAmnt) AS AvgOfDonationAmnt
FROM ((EventT INNER JOIN (BasicContactT INNER JOIN ParticipationT ON
BasicContactT.ContactID = ParticipationT.ContactID) ON EventT.EventID =
ParticipationT.EventID) INNER JOIN EventTypeT ON EventT.EventType =
EventTypeT.EventTypeID) LEFT JOIN DonationT ON ParticipationT.ParticipantID
= DonationT.ParticipantID
GROUP BY EventT.EventDateStart, EventTypeT.EventTypeName
ORDER BY EventT.EventDateStart;
I get an average, but it is skewed because the "Unknown Donor" contact does
not appear in the Participation Table and so, that donation is excluded (I
don't want Unknown Donor in the ParticipationT, it is only a value to
represent donations from sources at the event that we can't identify to a
specific participant). We know the donation came from someone at the event,
but not who.
Any help much appreciated. Thanks in advance.
Carol