First, Last, Min & Max Functions

aziz rasul

Active member
Local time
Today, 10:42
Joined
Jun 26, 2000
Messages
1,935
How are the First and Last functions different to the Min and Max functions.

If I have a table with values placed in a new table: -

3
5
1
2
4
6

the Min and Max functions produce 1 and 6 respectively. However the First and Last functions return values based on the order that the entries were made. The First function will return 3 and the Last function will return 6.

If I now place an index on the above field in ascending order so that I get:-

1
2
3
4
5
6

the First and Last function still return the same values as above, hence it seems to remember the order in which the entries were made AND IGNORES the actual values themselves and the order that they are in.

Hence my question really is what is the purpose of the First and Last functions? How and where is it used? The online help does say that you can obtain ambigious results but doesn't really explain why this should be. Any clarification would help.
 
The order the data was stored is not changed because of the index. The order the data is stored is not always in the order it was entered. First/Last has more functionality in recordset processing and subselects where you pretty much have know row values you are trying to grab.
 
Thanks for that.
 

Users who are viewing this thread

Back
Top Bottom