Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Skip
Message
From
05/09/2004 16:40:21
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Skip
Miscellaneous
Thread ID:
00939590
Message ID:
00939604
Views:
13
hi,

i want to insert ,
'areacode', ' ','Team', records from
 ?  ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100)*4 
it is mean ex...get 180 records form team 112
                 get140 records from team 113...etc
to new table as table2  and deleted from table1.
table2 has 180+140+....records
SELECT areacode, COUNT(*) ;
	FROM table1 ;
	GROUP BY 1 ;
	INTO ARRAY laAreas
* Process all areas
FOR lnAreInd = 1 TO ALEN(laAreas,1)
	lcArea = laAreas[lnAreInd,1]
	lnTotal = laAreas[lnAreInd,2]

	select areacode, team, count(*) ;
		from table1 group by areacode, team ;
		where areacode = lcArea ;
		ORDER BY 1,2 ;
		into array myArray

	? 'areacode', '     ','Team', 'Count', 'Percentaje'
	for i = 1 to alen(myArray, 1)
		? myArray[i, 1], myArray[i, 2], myArray[i, 3], ;
                   ROUND(myArray[i, 3] / lnTotal * 100,2)
                   ?  ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100)
                   ?  ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100)*4
                   
                   
	next i

ENDFOR
thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform