Limited query by field-Similar Issue

G

Guest

I have a membership db where I have a date field that tracks the date they
joined. January starts the new membership year. Throughout the year, we
have others who join. The date field is populated with the date they joined.

We have activities throughout the year and if members joined prior to the
activity and participated in that activity, they get credit for
participation. Those who joined after the activity, do not get credit for
that activity, but would get credit for the next and any subsequent
activities until the year ends in December

To receive a certificate at the end of the year, members must participate in
at least 3 activities.

I need queries that will count the number of activities of each member as
well as include those with different membership dates.

I have several tables already set up.
1 is a membership table with name, address, date joined, adult, youth, etc.
1 is a activities table with activity name, date
1 is a participation table with how each participant placed in the activity

Is this within the realm of one query or multiple queries?
Any help to tackle this would be great.
Thanks,
D
 
J

John Spencer

Guessing at table and field names, the query would look something like:

SELECT M.[Name], Count(P.Activity) as CountParticipated
FROM (Membership as M INNER JOIN Participation as P
ON M.MemberID = P.MemberID)
INNER JOIN Activities as A ON
P.ActivityID = A.ActivityID
WHERE M.DateJoined <= A.ActivityDate
GROUP BY M.[Name]

In the Query Grid:
Select all three tables
Join the tables on the appropriate fields
Put Name and Activity and Date Joined in the grid
Select View: Totals from the menu
In the totals line: Leave Name as Group by, Change Activity to Count, Change
Date joined to WHERE
In the criteria under Change Date enter
<= [ActivitiesTableName].[DateFieldName]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top