Access: Last Function

In Access, the Last function return a field value from the last record in the result set of a query.

The syntax for the Last function is:

Last ( expression )

The required expression argument is the value that you’d like to return from the result set. The Last function returns only the last value in the result set..


Last (ItemDesired)

VBA Code

Dim MyResult as String 
MyResult = Last(ItemDesired)

This example uses the Last function to return the last ItemDesired value.

SQL query

You can also use the Last function in a query.

SELECT Last([ItemDesired]) AS Expr1
FROM Orders



Leave a Reply

Your email address will not be published.