Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace sno with a sequence
Message
 
 
À
05/06/2005 23:44:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01020377
Message ID:
01020729
Vues:
17
lnNewSno = 0
lnOldSno = -1
SELECT table1
SCAN
	IF table1.sno <> lnOldSno
		lnOldSno = table1.sno
		lnNewSno = lnNewSno + 1	
	ENDIF
	REPLACE sno WITH lnNewSno
ENDSCAN
>
>I have a table entitled "Table1" containing following fields
>
>sno n(3)
>name c(20)
>
>Data in Table1 is as
>
>2 eric
>3 mike
>3 gagnon
>3 robert
>1 danial
>4 romani
>
>I want to replace sno, first field, with digits from 1 to !eof() but on every unique occourance as
>
>1 eric
>2 mike
>2 gagnon
>2 robert
>3 danial
>4 romani
>
>I mean the data of second field, name, must not change its order only first field should replace.
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform