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.
> >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 > >>