Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace sno with a sequence
Message
 
 
To
05/06/2005 23:44:40
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01020377
Message ID:
01020729
Views:
15
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform