>Sorry... won't work...
>
>Your select statement will choose the last record that has a higher value than 99.
>
>
>SELECT IIF(nfield>99, nfield, 99) FROM ....
>
>SELECT MAX(nField) FROM ... WHERE nField > 99
>
>IF _TALLY = 0
>nField =99
>ELSE
>nField = result.nfield
>endif
Paul is right; I forgot about filling the field to the desired length. Otherwise, it should emulate the max() function.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)