REPORTFORM;BR8.frf
TITLE;รายงานแสดงยอดชำระเช็ค ตามพนักงานขาย (เฉพาะเช็คผ่าน)
SQL;select bktr.DOCNO, bktr.CHKNO, bktr.DATECHK, bktr.DATEPASS, bktr.AMT_IN,
SQL;sum(arcard.RECAMT),
SQL;arcard_1.SALEID, salemst.SNAME,armst.xcomp, bktr.araccid
SQL;from bktr
SQL;left join arcard on bktr.DOCNO = arcard.DOCNO
SQL;left join arcard as arcard_1 on arcard.REFNO = arcard_1.DOCNO
SQL;left join salemst on arcard_1.SALEID = salemst.SID
SQL;left join armst on bktr.araccid = armst.accid
SQL;where left(bktr.TRTYPE,2) = 'AR' AND left(bktr.PAYTYPE,2) = '02'
SQL;and not isnull(datepass) AND CLRCHK = 1
SQL;group by 
SQL;bktr.DOCNO, bktr.CHKNO, bktr.DATECHK, bktr.DATEPASS, bktr.AMT_IN,
SQL;arcard_1.SALEID, salemst.SNAME,armst.xcomp, bktr.araccid
SQL;order by arcard_1.SALEID, bktr.datepass, bktr.docno
CONDITION;ตั้งแต่วันที่ผ่านเช็ค~BKTR.DATEPASS~Date~2~~
CONDITION;ตั้งแต่รหัสพนักงานขาย~ARCARD_1.SALEID~Chr~2~SELECT SID FROM SALEMST~SALE
EXCELSQL;select bktr.DOCNO, bktr.CHKNO, bktr.DATECHK, bktr.DATEPASS, bktr.AMT_IN,
EXCELSQL;sum(arcard.RECAMT),
EXCELSQL;arcard_1.SALEID, salemst.SNAME,armst.xcomp, bktr.araccid
EXCELSQL;from bktr
EXCELSQL;left join arcard on bktr.DOCNO = arcard.DOCNO
EXCELSQL;left join arcard as arcard_1 on arcard.REFNO = arcard_1.DOCNO
EXCELSQL;left join salemst on arcard_1.SALEID = salemst.SID
EXCELSQL;left join armst on bktr.araccid = armst.accid
EXCELSQL;where left(bktr.TRTYPE,2) = 'AR' AND left(bktr.PAYTYPE,2) = '02'
EXCELSQL;and not isnull(datepass) AND CLRCHK = 1
EXCELSQL;group by 
EXCELSQL;bktr.DOCNO, bktr.CHKNO, bktr.DATECHK, bktr.DATEPASS, bktr.AMT_IN,
EXCELSQL;arcard_1.SALEID, salemst.SNAME,armst.xcomp, bktr.araccid
EXCELSQL;order by arcard_1.SALEID, bktr.datepass, bktr.docno
