REPORTFORM;DB4_E.frf
TITLE;DEBT INFORMATION BY DUE DATE REPORT
SQL;select arcard.DOCNO, arcard.DATEDOC, armst.TERM, 
SQL;arcard.ACCID, armst.XCOMP, arcard.AMOUNT_D,
SQL;arcard.CUS_PO, arcard.SALEID, salemst.SNAME,
SQL;arcard.DUEDATE
SQL;from arcard
SQL;left join armst on arcard.ACCID = armst.ACCID
SQL;left join salemst on arcard.SALEID = salemst.SID
SQL;where left(arcard.TRTYPE,2) = "AR"
SQL;order by arcard.DUEDATE, arcard.DATEDOC, arcard.DOCNO
CONDITION;FROM DUE DATE~ARCARD.DUEDATE~Date~2~~
CONDITION;FROM CUSTOMER CODE~ARCARD.ACCID~Chr~2~SELECT ACCID FROM ARMST ~AR
EXCELSQL;select arcard.DATEDOC AS "วันที่เอกสาร", arcard.DOCNO AS "เลขที่เอกสาร", arcard.DUEDATE AS "วันครบกำหนด",
EXCELSQL;arcard.ACCID AS "รหัสลูกค้า", armst.XCOMP AS "ชื่อบริษัท", arcard.AMOUNT_D AS "ยอดเงิน", arcard.CUS_PO AS "เลขที่ใบสั่งซื้อ",
EXCELSQL;arcard.SALEID AS "รหัสพนักงานขาย"
EXCELSQL;from arcard 
EXCELSQL;left join armst on arcard.ACCID = armst.ACCID
EXCELSQL;where left(arcard.TRTYPE,2) = "AR"
EXCELSQL;order by arcard.DATEDOC, arcard.DOCNO
EXCELSQL; 
