Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Steroids needed
Message
De
01/04/2003 12:23:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00772404
Message ID:
00772513
Vues:
10
>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
>
Rob,
Checking your code's first part for a moment I thought I was looking at my code :) I have a similar working routine. However it's count for, select cnt() etc code slowing down the whole process (I took a different route for that part - faster but I need more :( )
Thanks for replying. Tomorrow I think I can provide my working prototype.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform