Tariq,
I had error in my first post. but after that I updated it. Did you try updated code?
>My dear Professor
>
>
>SELECT Trial
>index on code to a
>GO TOP
>lcFirstLeft = LEFT(code,1)
>lcNextReplace = 0
>SCAN
> IF NOT LEFT(code,1) == m.lcFirstLeft
> lcFirstLeft = LEFT(code,1)
> lcNextReplace = 0
> ENDIF
> m.lcNextReplace = m.lcNextReplace+1
> REPLACE code2 WITH INT(VAL(lcFirstLeft+PADL(m.lcNextReplace,2,[0])))
>ENDSCAN
>
>
>Your above codes display following results
>
>801--------1
>803--------2
>807--------3
>809--------4
>902--------5
>905--------6
>906--------7
>908--------8
>
>But I need following results
>column2=alltrim(substr(column1,1,2))+auto increment number starts from 1 as below
>
>801--------801
>803--------802
>807--------803
>809--------804
>902--------901
>905--------902
>906--------903
>908--------904
>
>Please help again
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.