Queries?

T

Tabby

Goodevening Everyone!

This is probably a lot simpler than most other questions.
I am not that proficient in Access and have run stuck.

I have a table called Members, and a table called
Contributions. The ID# links them together, is primary
key and unique records in Members table.

I want to create an update query that pulls all members
who have made contributions in the last 3 years, but it
keeps bringing up ALL contributions for the past 3 years
for each member. I only want to know who has given in the
last 3 years and do not want to see every contribution
they have made.

How do I set that criteria?

Thanks so much for your help.
 
K

Ken Snell

Try this SQL statement (use your own names for the fields):

SELECT Members.MemberID, Members.MemberName
FROM Members
INNER JOIN Contributions ON
Members.MemberID = Contributions.MemberID
WHERE Contributions.ContributionDate BETWEEN
DateAdd("yyyy", -3, Date()) AND Date()
GROUP BY Members.MemberID, Members.MemberName;
 
J

John Vinson

How do I set that criteria?

A Subquery. It's not all that obvious! Create a Query based on the
Membership table and under the ID# put

ANY (SELECT ID# From Contributions WHERE contributiondate >
DateAdd("yyyy", -3, Date()))
 

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