N
Nigel
In a table are fields QtyYear & QtyAmount. QtyYear contains the year (2007,
2008) for the donated amount (QtyAmount). But if no donation for that year
then no record.
I wanted to pull donors who gave in both 2007 & 2008. Not including folks
who gave in just one of those years. I've tried:
SELECT D.Donor
FROM TblOrg AS D
WHERE (((Exists (SELECT *
FROM TblQty YA
WHERE YA.OrgId = D.OrgId
AND YA.QtyYear = 2008))))
ORDER BY D.Donor;
which pulled all those who gave in 2008 regardless whether they gave in
2007. But I could not build on this query to get what I need. I also tried:
SELECT D.Donor, Y.LastYear
FROM TblOrg AS D, TblLastYear AS Y
WHERE (((Exists (SELECT *
FROM TblQty YA
WHERE YA.OrgId = D.OrgId
AND YA.QtyYear = Y.LastYear))=True))
ORDER BY D.Donor;
This has 2007 & 2008 in table TblLastyear. But it pulls those who donated in
2007 or 2008 or 2007 & 2008. I want just those who gave in both years.
Please can you help me out. Thanks Nigel
2008) for the donated amount (QtyAmount). But if no donation for that year
then no record.
I wanted to pull donors who gave in both 2007 & 2008. Not including folks
who gave in just one of those years. I've tried:
SELECT D.Donor
FROM TblOrg AS D
WHERE (((Exists (SELECT *
FROM TblQty YA
WHERE YA.OrgId = D.OrgId
AND YA.QtyYear = 2008))))
ORDER BY D.Donor;
which pulled all those who gave in 2008 regardless whether they gave in
2007. But I could not build on this query to get what I need. I also tried:
SELECT D.Donor, Y.LastYear
FROM TblOrg AS D, TblLastYear AS Y
WHERE (((Exists (SELECT *
FROM TblQty YA
WHERE YA.OrgId = D.OrgId
AND YA.QtyYear = Y.LastYear))=True))
ORDER BY D.Donor;
This has 2007 & 2008 in table TblLastyear. But it pulls those who donated in
2007 or 2008 or 2007 & 2008. I want just those who gave in both years.
Please can you help me out. Thanks Nigel