Solved

Query Consecutive Yearly Payments Access 2007

Posted on 2009-04-13
4
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

696 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