View Single Post
  #3  
Old October 23rd, 2008, 11:01 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default How to design table for query info I need

On Thu, 23 Oct 2008 13:15:00 -0700, Ladypep13
wrote:

The Members table has a field which shows the next renewal date. Each month,
we pull out all the members whose renewal date is within that month and send
them a letter reminding them. The letter also says, "Your last contribution
of ____" and is filled in from the merge.

Here is my problem. I need my query to pull out the current month renewals
(no problem there, already done that) AND pull out only the very LAST
contribution they made.

Since each member's last contribution amount may have been on a different
date, I can't write the query to pull by a specific date, nor can I have it
pull by a or date.

Does anybody have any idea how I could design my Contributions table in
order to be able to pull out only the most current data on EVERY member and
merge it into a Microsoft Word form letter? It could be as simple as adding
an additional field, I don't know.


No additional field is needed.

Instead, use a Subquery. As a criterion on the donation date field put

=(SELECT Max([donation date]) FROM donations AS X WHERE X.MemberID =
Members.MemberID)

This will filter the set of all donations from that member to show only the
most recent of them.
--

John W. Vinson [MVP]