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!

A List of Donors

Status
Not open for further replies.

kpsony

Technical User
Sep 7, 2004
37
US
I work for a non profit and we need to do a query for a committee report. I have a table of Donors and a table of the Gifts the donors have given. They all have a unique donor ID, which is how their gifts are distinguished. I need to do a query on people who have ever given over $250.00.

Any help? I am fairly new to access, but do know the basics.

Thanks,

Brian
 
A starting point:
SELECT D.Name, Sum(G.amount) As Total
FROM tblDonors AS D INNER JOIN tblGifts AS G ON D.ID = G.donorID
GROUP BY D.Name
HAVING Sum(G.amount) > 250;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It says enter parameter value for d.name... ?
 
You obviously have to replace the fields and tables names with yours.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The Fields are as follows:
FIRST NAME/LAST NAME/PRIMARY ADDRES 2/ -- in our Donor DB

GIFT AMOUNT/Date of Event/Donor ID/ -- in our Gift DB
 
Sorry, I am still having trouble... I've tried this
Code:
SELECT [FIRST NAME], Sum(GIFT AMOUNT) As Total
FROM [The Trevor Project Database] AS D INNER JOIN tblgifts AS G ON [Donor ID] = [Gift ID]
GROUP BY [FIRST NAME]
HAVING Sum(GIFT AMOUNT) > 250

It still is not working--saying missing operator sum(gift amount)...

Here is what I am doing. Im creating a query in design view. I choose the gift table and the trevor project table. I connect the 2 with the DOnor ID Field.

I go into the MySQL View and paste that code.

Is that correct?
 
Replace the 2 instances of this:
Sum(GIFT AMOUNT)
By this:
Sum([GIFT AMOUNT])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
oh boy--now im getting 'Join expresson not supported' then it highlights
Code:
[Donor ID] = [Gift ID]
 
BTW total by only 1st name is that you really want ?
I suggest at least this:
SELECT [FIRST NAME], [LAST NAME], Sum([GIFT AMOUNT]) As Total
FROM [The Trevor Project Database] AS D INNER JOIN tblgifts AS G ON [Donor ID] = [Gift ID]
GROUP BY [FIRST NAME], [LAST NAME]
HAVING Sum([GIFT AMOUNT]) > 250

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I wanted to total by first & last name with their address.

Thank you for all your patience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top