REPORTFORM;BP3.frf
TITLE;รายงานจ่ายชำะหนี้ ตามรหัสแผนก วันที่
SQL;SELECT 
SQL;APCARD.DOCNO,
SQL;APCARD.DATEDOC,APCARD.REFNO,
SQL;APCARD.DATEINV, APCARD.DUEDATE, APCARD.ACCID,
SQL;APCARD.DPTID, APMST.XCOMP, APCARD.RECAMT,
SQL;DEPART.DDESC,
SQL;APCARD_1.DOCNO,APCARD_1.DPTID AS XDPTID
SQL;FROM APCARD LEFT JOIN APMST ON APCARD.ACCID = APMST.ACCID
SQL;LEFT JOIN APCARD AS APCARD_1 ON APCARD.REFNO = APCARD_1.DOCNO
SQL;LEFT JOIN DEPART ON APCARD_1.DPTID = DEPART.DID
SQL;WHERE LEFT(APCARD.DOCNO,2) = 'BP'
SQL;ORDER BY APCARD_1.DPTID, APCARD.DATEDOC, APCARD.DOCNO
CONDITION;ตั้งแต่รหัสแผนก~APCARD_1.DPTID~Chr~2~SELECT DID FROM DEPART~DEP
CONDITION;ตั้งแต่วันที่~APCARD.DATEDOC~Date~2~~
