Dawa,
I think the fastest would be following code because LOCATE is Rushmore optimizable with index set and GO BOTTOM is not. The separate SET order command doesn't move pointer to the first record also.
SELECT 0
USE mydb!table1
SET ORDER TO field1 DESC
LOCATE
m.lnMax = table1.field1
USE IN table1
>
>I have a table with an integer field indexed ascending. To retrieve the maximum value of that field, which is the faster approach below:
>
>Approach 1:
>
>USE mydb!table1 IN 0 ORDER field1
>GO BOTTOM
>m.lnMax = table1.field1
>USE IN table1
>
>
>Approach 2:
>
>USE mydb!table1 IN 0 ORDER field1
>CALCULATE MAX(table1.field1) TO m.lnMax
>USE IN table1
>
>
>If one is faster the other, then why?
>
--sb--