Greetings.
I need help with a simple Access 2000 query. Let’s say I have a table that contains log entries for multiple people with the following fields:
LogID (primary key)
Name
EntryDateTime
TheLogEntry
In this table, there will be multiple entries for multiple people. Let’s assume the values in EntryDateTime will be different for each entry. BUT, do not assume that the EntryDateTime values are sequential when sorted by LogID for any selected Name.
MY GOAL is to create a query that will return one record for each person with fields Name, EntryDateTime and LogID, and the one record for each person will contain values based on the record in the table that has the MOST RECENT EntryDateTime value for each person.
I know in my SQL statement I’ll need a Group By statement for the Name field and to use Max of EntryDateTime, but what do I specify for the LogID field? If I use Group By, then I’ll get more than one record per Name. If I don’t use Group By, how do I tell it to give me the appropriate LogID for the record with the most recent EntryDateTime value?
Thanks in advance!
I need help with a simple Access 2000 query. Let’s say I have a table that contains log entries for multiple people with the following fields:
LogID (primary key)
Name
EntryDateTime
TheLogEntry
In this table, there will be multiple entries for multiple people. Let’s assume the values in EntryDateTime will be different for each entry. BUT, do not assume that the EntryDateTime values are sequential when sorted by LogID for any selected Name.
MY GOAL is to create a query that will return one record for each person with fields Name, EntryDateTime and LogID, and the one record for each person will contain values based on the record in the table that has the MOST RECENT EntryDateTime value for each person.
I know in my SQL statement I’ll need a Group By statement for the Name field and to use Max of EntryDateTime, but what do I specify for the LogID field? If I use Group By, then I’ll get more than one record per Name. If I don’t use Group By, how do I tell it to give me the appropriate LogID for the record with the most recent EntryDateTime value?
Thanks in advance!