Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Additon in character type data
Message
From
29/06/2006 23:42:12
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01132547
Message ID:
01132972
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform