Last

Return the last value from the result set of a query. (SQL).

Syntax
      Last (expression)


Key
   expression   The value/column to return.

The First and Last functions are analogous to the MoveFirst and MoveLast methods of a DAO Recordset object. They return the value of a specified field in the first or last record, respectively, of the result set returned by a query.

The Last() function can be used in a Group By (Aggregate) SQL query.

Last Function

This will return, for each surname the largest and smallest StaffID for the people with that surname.

Examples

Select Last(sales_id) 
from T_Sales 
Group By Department;

“Winning takes talent; to repeat takes character.” ~ John Wooden

Related

First - Return the first value from a query.


 
Copyright © 1999-2024 SS64.com
Some rights reserved