>>You're not wrong. MAX() should return the largest value. If there's a group by including the field, then it'll be the largest value for that group. If not, then it'll be the largest field value regardless. AFAIK, there's no SQL statement that, under these circumstances, is guaranteed to return the value of the last physical record.
>
>The behavior of VFP (and FP 2.x before it) has always been to return the field value from the last physical record in the group when a field is not include in the GROUP BY clause and has no aggregate function applied. As we all know, that's not necessarily either the minimum or maximum value for that particular field.
>
Tamar,
Thanks for the input. I've never relied, however, on this particular behavior since, AFAIK, it's not documented and I don't know if this behavior is the same on SQL Server 6.5 and/or Sybase, both of which don't include the restriction on non-aggregate fields being in the group by clause.
George
Ubi caritas et amor, deus ibi est