First, Last Functions (SQL Only)

See AlsovbfctSQLFirstSee

Description

Return a field value from the first or last record in a query.

Syntax

First(expr)

Last(expr)

Remarks

The First and Last functions use the following argument.

Argument        Description

 

expr                 String expression identifying the field that contains the data you want to use, or an expression that performs a calculation using the data in that field.  Operands in expr can include the name of a table field, or a Visual Basic function (which can be intrinsic but not a user-defined function or one of the other domain aggregate or SQL aggregate functions).

 

You can use First and Last to determine the limits of the underlying query.  For example, the records returned by First and Last might contain order dates that you could use in a report title to identify the range for orders.

You can use First and Last in a query expression.