Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in SQL
Message
From
25/09/2005 23:58:06
 
 
To
25/09/2005 15:40:31
Chandan Chakraborty
Bangiya Gramin Vikash Bank
Raiganj, India
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052750
Message ID:
01052919
Views:
16
Assuming that all the IF statements are mutually exclusive and lnBalance gets only one result, it appears to me that you could have one IF-ELSE statement based on lnAcno. You could then put a DO CASE statement in each block . Arrange the CASE statements so that the most likely ones are first to be tested.
IF lnAcno = acno
     DO CASE
          CASE < test one >
               lnBalance = 0
          CASE < test two >
               lnBalance = lnMbalance
          CASE < test three > 
                etc.
     ENDCASE
ELSE
     DO CASE
          CASE < test one >
             etc
     ENDCASE
ENDIF
>All my tables are properly indexed.But there are several if conditions.I think these checkings are slowing my prg but they are obvious.
>
>Here is my code:
>
>
>
>if  month(date)<month(Mdate) AND lnAcno=acno  AND year(Mdate)=year(date)
>lnBalance=0
>endif
>
>if  lnAcno=acno  AND year(Mdate)>year(date) and lnBalance=0 and month(date)<month(Mdate)+12
>lnBalance=lnMbalance
>endif
>if  lnAcno=acno  and  MONTH(date)=MONTH(Mdate)  and  day(date)<=10  and year(Mdate)=year(date)
>
>lnBalance=lnBbalance
>endif
>
>*** so many
>
>
>
>How I can change my code to speed it up.If you allow I can send the code to you via email.
>
>Chandan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform