Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up code-scan,update (follow-up from last Thursday)
Message
From
19/08/2008 13:01:43
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Speeding up code-scan,update (follow-up from last Thursday)
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01340003
Message ID:
01340003
Views:
58
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
Next
Reply
Map
View

Click here to load this message in the networking platform