Solved

Query Consecutive Yearly Payments Access 2007

Posted on 2009-04-13
4
314 Views
Last Modified: 2013-11-29
I have an Access 2007 database which contains a list of donations by our patrons.  I need to pull a list of donors by account number who have made annual donations in consecutive years of a hundred dollars or more.

The screen shot shows my data from Table1 .  I have only managed to pull out the people who have made donations>= 100 dollars.  RACCOUNT is the account number, RYEAR=year donation was made, and Donation_Total is the total donations made that year.

Anyways, i've tried creating an extra year field and using count functions but I'm really at a loss of where to start this,   Any help would be appreciated, ty!
screenshot.JPG
0
Comment
Question by:forcefeeld
4 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 24131685
what exactly are you trying to do?
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 24131785
Hello forcefeeld,

This query will pull consecutive years with >=100...

SELECT t1.RACCOUNT, t1.RYEAR, t2.RYEAR AS PriorYear, t1.Donation_Total, t2.Donation_Total AS PriorTot
FROM table1 t1 INNER JOIN
      table1 t2 ON t1.RACCOUNT = t2.RACCOUNT And t1.RYEAR = (t2.RYEAR + 1)
WHERE t1.Donation_Total >= 100 And t2.Donation_Total >= 100

Regards,

Patrick
0
 
LVL 28

Expert Comment

by:TextReport
ID: 24131957
I see from your NavigationBar that you have created a crosstab query called 01_Donation_History_Crosstab, from this you can create a query on the crosstab and have the YEAR Total fields available and then it is just a case of putting the criteria against the years you are interested in.

BTW You may wish to use FIXED COLUMN HEADIONGS in the Crosstab soecifying the years you want and ensuring they are all available despite any other selection criteria you put in the query.

Cheers, Andrew
0
 

Author Closing Comment

by:forcefeeld
ID: 31569605
Thanks! worked like a charm!  Even better, you got it to list both payments that are consecutive, so i was able to check its validity with the original data.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now