Either I'm missing something or your question does not make sense.
Unless you're storing the "LastCommuned" date somewhere (WHY??? You
can use a SQL statement to calculate it for you on the fly!)
If you just calculate on the fly, you don't need any code at all.
What did you need to do with this? If you're going to do a mail merge
or similar, you can just create another query and include both the
ChurchMember table (or whatever you call it) and this totals query and
include other values. Michel Walsh has an article on this at
www.mvps.org/access
"pietl...@hotmail.com" wrote:
> .
>
Assuming you have a structure like
CREATE TABLE Communion(
ChurchMemberID INT NOT NULL,
CommunionDate DATE NOT NULL,
PRIMARY KEY (ChurchMemberID, CommunionDate)
)
doing the following will give you the last CommunionDate for each member.
SELECT ChurchMemberID, Max([CommunionDate])
FROM tblMember LEFT JOIN tblCommunion ON tblMember.MemberID = tblCommunion.
ChurchMemberID
ORDER BY ChurchMemberID
GROUP BY ChurchMemberID;
Then you can join that query back to the Members table on ChurchMemberID, and
get the member's name, address, and all that ...
(Hey, John... tell him why storing derived/calculated values is a bad idea...)
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201001/1