Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do while problem
Message
 
To
03/06/2005 03:20:16
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019676
Message ID:
01019705
Views:
18
This message has been marked as the solution to the initial question of the thread.
SELECT VOUCHERS
*** NEVER use a functions as ALLTRIM, LTRIM or RTRIM in INDEX expresion
*** or If you have to, make sure that after their use you make the expresion with constant lenght
INDEX ON DTOS(DATE) + STR(VOU_NO, 5) + PADR(ALLTRIM(VOU_TYPE), 20) TO VOUCHERS1 

SELECT vou_sum
INDEX ON DTOS(DATE) + STR(VOU_NO, 5) + VOU_TYPE TO VOU_SUM1

SELECT VOUCHERS
REPLACE all d1 with ""

SELECT vou_sum
SCAN
   cc = PADR(ALLTRIM(Vou_Sum.Vou_Type),20) && character type
   SELECT VOUCHERS
   SEEK DTOS(Vou_Sum.Date)+STR(Vou_Sum.Vou_No,5)+ cc
   IF Found()
      REPLACE D1 WITH Vou_Sum.D1 WHILE;
                                 DTOS(DATE) + STR(VOU_NO, 5) + PADR(ALLTRIM(VOU_TYPE), 20) == DTOS(Vou_Sum.Date)+STR(Vou_Sum.Vou_No,5)+ cc
   ENDIF
   SELECT Vou_Sum
ENDSCAN
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform