>Dear Experts
>
>Table1 has only one field as
>
>code c(7)
>
>data in table is as follows
>
>1
>11
>1101
>1102
>1103
>12
>1201
>13
>1301
>1304
>
>How to findout max code in 2 digits starting with 1
>
>The answer is 13
>
>Please help
SELECT MAX(Code) AS MAxCode;
FROM YourTable;
WHERE LEN(ALLTRIM(Code)) < 3;
INTO ARRAY aMaxCode
?aMaxCode[1]
not tested
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.