Just clarify for some folks who may review this,
actually, I used the same code as Jacco suggested. Clng
(ID) was not good for SQL.
>Thank you, Jacco. That's exactly the problem I had. I
>just used Clng(ID) instead of Convert and it worked
>perfectly. I appreciate it.
>>You have make the ID column an INT instead of a
>>ordered alphabetically, so 9 will be the maximum until
>you get to 90.
>>If you can't change the datatype of the ID column,
>change your code to:
>>SELECT MAX(CONVERT(INT, ID)) FROM TABLE
>>SQL Server MVP
>>> I am using the routine:
>>> SELECT ID FROM TABLE where ID=(SELECT MAX(ID) FROM
>>> to obtain the maximum ID in the table, then ID = ID +
>>> to insert a new record with new ID. However, after
>>> creating a record with ID = 9, it continued giving the
>>> same number. Therefore new number is always 10.
>>> This happened again when another ID became 99. It
>>> continued creating recordset with ID = 100.
>>> What causes this problem? How can I overcome it?
>>> I would really appreciate any help on this one.