Hi,
this access based on Borislav's approach could also be an option
If automatically generates the between-values, assuming, those values will always lie between 10-19/20-29/30-39/ and so on.
startcode = [11]
SELECT MAX(Code) AS MaxCode;
FROM test1;
WHERE BETWEEN(INT(VAL(code)),INT(VAL(startcode)),INT(INT(VAL(startcode))/10)* 10 + 9);
Best Regards
-Tom
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011