First/Last of related Records

baldeagle

Registered User.
Local time
Today, 09:33
Joined
Nov 9, 2004
Messages
38
The "last" total in an Access query is unpredictiable. I have a Journal, with the main form/dataset being linked to the entries of that day. I would expect the 'last' total word to give me the last entry of that day, ie. what I ate for supper. But in the two qrys shown, it does the opposite. What is the most relable way to get the last entry of that day (ie. the one with the highest journalID)? :confused:

Sample Database attached.
 

Attachments

SELECT Col1, COl2, Col3, journalID
FROM MyTable
WHERE journalID = (SELECT MAX(journalID) from MyTable)
 
That works for finding the very last entry of the Journal (as a whole). However, I want the very last entry of each day, ie. the supper description of each day
 
You can do it with a series of two queries.

Run the second query in the database.
.
 

Attachments

You can add a datecheck in the subselect
 
Worked like a champ. Thanks, FoFa.
BTW: What part of the state are you from?
 
Cool. I'm over in Channelview/Downtown Houston, having escaped for College Station.

Its neat when the interweb isn't really all that big of a place.
 

Users who are viewing this thread

Back
Top Bottom