[AccessD] Need most recent record from many

Gustav Brock gustav at cactus.dk
Sat Mar 29 04:16:05 CST 2003


Hi Bob

Oh, it wasn't meant so, of course - hopefully Susan is not
embarrassed. Believe me, my "book" has bunches of blank pages - among
these are those describing how Williams' brain is functioning.

/gustav


> <pained expression>

> "it's easy when you know how .. "

> OUCH!  I know my methods are often novice-level, but that was brutal  :)

> </pained expression>

> Bob Gajewski


> On Friday, March 28, 2003 13:27 PM, Gustav Brock [SMTP:gustav at cactus.dk] wrote:
>> Hi Susan
>> 
>> As always, it's easy when you know how .. 
>> Here is one method:
>> 
>> <SQL>
>> 
>> SELECT
>>   tblMember.*,
>>   (SELECT TOP 1
>>     datReceived
>>   FROM
>>     tblPayment
>>   WHERE
>>     (tblMember.ID = tblPayment.MemberID)
>>   ORDER BY
>>     datReceived DESC;) AS LastPayment
>> FROM
>>   tblMember;
>> 
>> </SQL>
>> 
>> /gustav
>> 
>> 
>> > I hope this is so easy I'll be embarrassed I even asked, but.. 
>> > I have a query that links two tables with a one-to-many relationship.  My 
>> > problem is that I want to pull only the most current record on the many 
>> > side.  I know this has to be something easy, but I'm either blind to it or 
>> > just not able to figure out where to start looking.  I tried to access the 
>> > archives, but the link takes me to the mail options page 



More information about the AccessD mailing list