Counting Subquery Syntax

T

Tal

Hello,
Can somebody please tell me why I am getting a syntax error in the subquery?
This is my first subquery, so... could be I have the whole thing upside down.

SELECT Count(tblDonations.keyDonation) AS CountOfkeyDonation,
qryClientFileAs.compFileAs, Sum(tblDonations.curDonationAmount) AS
SumOfcurDonationAmount, (SELECT Count(tblDonations.keyDonation) AS
CountOfCards WHERE tblDonations.keyFund=1)
FROM tblDonations INNER JOIN qryClientFileAs ON tblDonations.keyDonor =
qryClientFileAs.keyClient
GROUP BY qryClientFileAs.compFileAs, tblDonations.ynDonationPaid
HAVING (((tblDonations.ynDonationPaid)=Yes))
ORDER BY Count(tblDonations.keyDonation) DESC;

Many thanks,
Tal
 

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