Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Steroids needed
Message
 
À
01/04/2003 10:12:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00772404
Message ID:
00772502
Vues:
15
I think you can do something like this; first make a cursor of all the distinct nstart and nend points for each type, and then count up the records in the original data.
CLOSE TABLES
USE results excl 
ZAP IN results
USE cetin.dbf
SELECT DISTINCT ;
	checkdate, xclusive, id1, id2, nstart AS nValue ;
	FROM cetin ;
UNION ;
	SELECT DISTINCT ;
	checkdate, xclusive, id1, id2, nend AS nValue ;
	FROM cetin ;
INTO CURSOR curValues ;
ORDER BY 1,2,3,4,5
SELECT curValues
SCATTER MEMVAR
m.id1 = m.id1+1		&& so first record doesn't match
SCAN
	IF m.checkdate=checkdate AND m.xclusive=xclusive AND;
	   m.id1=id1 AND m.id2=id2

		SELECT cetin
		COUNT FOR nstart<=m.nvalue AND nend>=curValues.nvalue ;
				AND checkdate=curValues.checkdate AND xclusive=curValues.xclusive ;
				AND id1=curValues.id1 AND id2=curValues.id2 ;
			TO lnCount

		INSERT INTO results (checkdate, xclusive, id1, id2, nstart,nend,ncnt) ;
			VALUES (curValues.checkdate, curValues.xclusive, ;
				curValues.id1, curValues.id2, m.nvalue, curValues.nvalue, lnCount)
	ENDIF
	SELECT curValues
	SCATTER MEMVAR
ENDSCAN

SELECT results
BROWSE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform