Is Access selecting the First() value from the same record as the Max() value is determined?
possibly, but unlikely
not for max, but first is the first in the recordset - without an order that can change each time the query is run
simple example
SELECT Max(Date) as MaxDate, First(Date) as FirstDate FROM myTable
will produce a different result to
SELECT Max(Date) as MaxDate, First(Date) as FirstDate FROM myTable ORDER BY Date
Any way to avoid a sub-query?
depends what you are trying to do - perhaps you can use another query instead (will generally be faster)
Assuming your recordID is a unique field, grouping makes no sense for your query since all records will be returned
How do I keep an existing record intact if that is not the default behaviour?
if you are trying to find the latest record for each contact based on the largest ID for a contact you might have
Code:
SELECT C.*
FROM tblContacts C
WHERE ID=dmax("ID","tblContacts","Name='" & Name & "'")
or
Code:
SELECT C.*
FROM tblContacts C
WHERE ID=(SELECT Max(ID) FROM tblContacts T WHERE Name='" & C.Name & "'")
or
Code:
SELECT C.*
FROM tblContacts C INNER JOIN (SELECT Max(ID) as MaxID FROM tblContacts GROUP BY Name) T ON C.ID=T.MaxID