REPORTFORM;AO3.frf
TITLE;รายละเอียดการจ่ายเงินมัดจำ ตามรหัสแผนก
SQL;select downpay.DOCNO, downpay.DATEDOC,
SQL;downpay.ACCID, apmst.XCOMP,
SQL;downpay.AMOUNT_D, downpay.CLRAMT, downpay.NBAL, 
SQL;downpay.DPTID, depart.DDESC, downpay.invamt, downpay.vatamt
SQL;from downpay 
SQL;left join bktr on downpay.DOCNO = bktr.DOCNO
SQL;left join apmst on downpay.ACCID = apmst.ACCID
SQL;left join depart on downpay.DPTID  = depart.DID
SQL;group by downpay.DOCNO
SQL;order by downpay.DPTID, downpay.DOCNO
CONDITION;ตั้งแต่รหัสแผนก~DOWNPAY.DPTID~Chr~2~SELECT DID FROM DEPART~DEP
CONDITION;ตั้งแต่วันที่เอกสาร~DOWNPAY.DATEDOC~Date~2~~
EXCELSQL;select downpay.DOCNO, downpay.DATEDOC,
EXCELSQL;downpay.ACCID, apmst.XCOMP,
EXCELSQL;downpay.AMOUNT_D, downpay.CLRAMT, downpay.NBAL, 
EXCELSQL;downpay.DPTID, depart.DDESC, downpay.invamt, downpay.vatamt
EXCELSQL;from downpay 
EXCELSQL;left join bktr on downpay.DOCNO = bktr.DOCNO
EXCELSQL;left join apmst on downpay.ACCID = apmst.ACCID
EXCELSQL;left join depart on downpay.DPTID  = depart.DID
EXCELSQL;group by downpay.DOCNO
EXCELSQL;order by downpay.DPTID, downpay.DOCNO
