Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up code-scan,update (follow-up from last Thursd
Message
 
To
19/08/2008 13:01:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01340003
Message ID:
01340006
Views:
12
>Hi all,
>
>Follow-up from last Thursday's thread# 1338981
>
>this is one scan endscan that I have in my program ( I inherited it, working on cleaning it up. :D)
>
>SELECT srvceid, COUNT(DATE) AS wrksrvceDate , ALLT(STR(MONTH(DATE)))+ALLT(STR(YEAR(DATE))), ;
>  C1, C4 ;
>  FROM cost, cstcoef ;
>  WHERE cost.costcoef == cstcoef.coefid AND ;
>  (RIGHT("00"+ALLT(STR(MONTH(DATE))),2)+ALLT(STR(YEAR(DATE)))=ALLTR(sPeriod) ;
>  AND NOT EMPTY(dateappr) AND ALLT(STATUS)=='' AND NOT schoolclose AND NOT Cancelled) ;
>  GROUP BY srvceid, C1, C4 ;
>  INTO CURSOR c7
>
>SELECT (sCur)
>GO TOP
>SCAN
>  SELECT (sCur)
>  UPDATE BL731 SET BL731.wrksrvceDate=c7.wrksrvceDate ;
>    WHERE srvceid=c7.srvceid AND C1 = c7.C1 AND C4 = c7.C4
>ENDSCAN
>USE IN c7
>
>
>Rich suggested that I use index and replace all. My problem with indexes is that srvceid is a character field and c1 and c4 are numeric. How would I make a index for a character and numerical index without causing problems for the data?
>
>TIA
>Beth

INDEX ON srvceid + BINTOC(c1) + BINTOC(c4) TAG Whatever
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform