>create sql view lv_intcalcsource as ; >select InvHead.cinvoi_key, ; > <snip> > InvHead.cPenRevAcc ; > from hea!InvHead inner join hea!Company ; > on InvHead.cCompa_Key = Company.cCompa_Key ; > where ; > ( DaysToPaid() > IntCalc.ic_days .and. .not. lFullyPaid ) ; > .or. ; > ( lFullyPaid .and. ; > ceiling( (DaysToPaid() - IntCalc.ic_days) / 30 ) + 1 > ; >$ (select count(*) ; >$ from InterestDetails ; >$ where InvHead.cInvoi_Key = cDet_InvoiKey) ) ; > order by Company.cCompanyName, InvHead.dCompletionDate