Return the last value from a specified set of records.
Syntax DLast ( expression, domain, [criteria] ) =DLast("[Field]", "Table", "[Field] = 'MyValue'") Key expression The field to return. domain The set of records, a table or a query name. criteria Equivalent to an (optional) WHERE clause. Any field that is included in criteria must also be a field in domain.
To return the first or last record in a set of records (a domain), create a query sorted as either ascending or descending and set the TopValues property to 1.
The DLast() function may be used in VBA or in an SQL query.
Dlast("OrderID", "qryOrders", "SupplierID = 64 ")
This is equivalent to:
“If you are planning for a year, sow rice; if you are planning for a decade, plant trees; if you are planning for a lifetime, educate people” ~ Chinese Proverb
Last (SQL) - Return the last value from a query.