Last aggregate function

G

Gus Chuch

The SQL Last function is to return the last value entered in a record, right?
The follow code will sometimes return the last entered value and sometime
not, why?
SELECT Last(tblEquipment.EquipmentID) AS LastOfEquipmentID
FROM tblEquipment;
 
D

Douglas J. Steele

Last doesn't return "the last value entered in a record", it returns "the
last value in a recordset". Since you cannot be sure of the order in which
records are returned if you don't have an ORDER BY clause in your SQL, you
can never be sure what Last will return for your query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top