How to select the last of multiple same values

CharlesWh

Registered User.
Local time
Today, 18:31
Joined
Jan 19, 2006
Messages
36
I'm building a database which needs to lookup a value from another database.

The other database records users logging in and out and records their mac address.

What's the best way for me to tell access to look for a particular mac address but the last one as distinct from all the others?

Any advice thankfully received.
 
If there is a date field, make a query that includes ORDER BY with the DESCENDING option and then find the first record in the query's recordset (not the table) that matches your user ID. An example of that famous Biblical quote about 'the first shall be last and the last shall be first' - or something like that.
 
Thanks for your reply and off the back of that I have constructed the following. So where there may be a customer id number 105 and twenty entries for that customer id the following picks the latest entry of that customer id.

Code:
SELECT DISTINCT Last(radacct.RadAcctId) AS LastOfRadAcctId, radacct.UserName
FROM radacct
GROUP BY radacct.UserName;
 

Users who are viewing this thread

Back
Top Bottom