>Cetin
>
>>max() function is different from SQL max(). SQL max operates on expressions returning a scalar value.
>>What do you really want to do ? Do aggregation and stil get max of result vs 99 ? Something like max of multiple fields ?
>
>Well I just wanted the arithmetic MAX() function. (Sorry folks - not the SQL version). It seems that the arithmetic MAX() is overloaded by the other one when you use it in a query.
>
>>? max(f1, f2, f3, f4) && Would return max of f1..f4 num fields
>Yes, this one works nicely.
>
>>select iif(nField>99, nField, 99*1) as Column1 from myTable
>The trouble is, what if 'nField' is a longer expression? Then it gets a bit cumbersome to use this syntax. Which is why it would be nice to have the humble MAX() back for simplicity.
>
>>select max(max(nField, 99*1)) as Column1 from myTable
>Are you sure this one will work?
>
>>Note that in last sample outer max is SQL aggreagation function whilst inner max is VFP's max() function.
>Inner one won't work!
>
>Thanks
>John
John,
Did you try the sample ? Inner one works as arithmetiuc max.
Cetin