> >Sample No. 1 > >Select CVdtl >set order to CVnoacct >IF Seek(lcDocNumb) > scan while CV_no=lcDocNumb IF not DELETED() > lnSLDBAmt = lnSLDBAmt + SLDebit > lnSLCRAmt = lnSLCRAmt + SLCredit > lnGLDBAmt = lnGLDBAmt + GLDebit > lnGLCRAmt = lnGLCRAmt + GLCredit > Endif > enddo >ENDIF>
>SELECT SUM(A.SLDebit) as lnSLDBAmt, SUM(SLCredit) as lnSLCRAmt, ; SUM(GLCredit) as lnGLCRAmt, SUM(GLDebit) as lnGLDBAmt; >FROM CVdtl A WHERE A.CV_no=lcDocNumb .and. .not. DELETED() INTO CURSOR Temp1 GROUP BY A.CV_noOR
SET DELETED ON SELECT SUM(SLDebit) as lnSLDBAmt, SUM(SLCredit) as lnSLCRAmt, ; SUM(GLCredit) as lnGLCRAmt, SUM(GLDebit) as lnGLDBAmt, Cv_No ; >FROM CVdtl WHERE CV_no=lcDocNumb GROUP BY Cv_NO into cursor curTemp>
>Select CVdtl >*set order to CVnoacct - comment this out >SCAN FOR CV_no=lcDocNumb > IF .not. DELETED() > lnSLDBAmt = lnSLDBAmt + SLDebit > lnSLCRAmt = lnSLCRAmt + SLCredit > lnGLDBAmt = lnGLDBAmt + GLDebit > lnGLCRAmt = lnGLCRAmt + GLCredit > Endif >ENDSCAN > >>