Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query critieria showing past dates only 1

Status
Not open for further replies.

domino3

MIS
May 20, 2003
307
GB
I have a table of people who have fundraised in the past. This is linked to a table of fundraised amounts and dates. Some people will only have fundraised once, others several times. What I am trying to do is write a query that picks out the people that have not fundraised since 2001. I thought the way to do this would be to select last in the group totals and the query I have tried is:

SELECT Maintable.ID_No, Maintable.Lastname, Maintable.Firstname, Last(T_funds.Funds_received) AS LastOfFunds_received
FROM T_funds RIGHT JOIN Maintable ON T_funds.ID_No = Maintable.ID_No
WHERE (((Maintable.JoinDate)<#1/1/2001#) AND ((Maintable.Membership_Type)="donor"))
GROUP BY Maintable.ID_No, Maintable.Lastname, Maintable.Firstname
HAVING (((Last(T_funds.Funds_received))<#1/1/2001#));

However, I still get people who fundraised since 2001. Is there any way of writing this query and making it work?

Thank you.
 
I think you want to replace 'Last' in yoru query with MAX, and then it should work for you.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
I think you need to use the "NOT EXISTS" clause to find them.
an example below.
It shows thos members that are not paid their membership fee on a selected month.
Code:
SELECT
  * 
FROM
  tblPayingMembers 
WHERE NOT EXISTS (
  SELECT
    * 
  FROM
    QryFullCollectionMonthFormat 
  WHERE tblPayingMembers.PayingMemberName=QryFullCollectionMonthFormat.CollectedFrom 
    AND QryFullCollectionMonthFormat.CollctedMonth=Forms!frmMainMembers.cboMonths
  );

________________________________________________________
Zameer Abdulla
Help to find Missing people
Take the first step in faith. You don't have to see the whole staircase, just take the first step.
(Dr. Martin Luther King Jr.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top