Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Additon in character type data
Message
De
29/06/2006 23:42:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01132547
Message ID:
01132972
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform