REPORTFORM;AJ1_E.frf
TITLE;ADJUST INFORMATION REPORT
SQL;select invcard.DOCNO, adjhead.XREMARK,
SQL;invcard.DATEDOC, invcard.ID, invmst.XDESC,
SQL;invcard.QUAN, invcard.UNIT, invcard.COST,
SQL;invcard.COSTAMT, invcard.LOCID, adjhead.FLAG
SQL;from invcard 
SQL;left join adjhead on invcard.DOCNO = adjhead.DOCNO
SQL;left join invmst on invcard.ID = invmst.ID 
SQL;where left(invcard.DOCNO,2) = "AJ"
SQL;order by invcard.DOCNO,invcard.DATEDOC,invcard.ID,invmst.XDESC
CONDITION;FROM DOCUMENT~INVCARD.DOCNO~Chr~2~SELECT DOCNO FROM ADJHEAD~
CONDITION;FROM DATE~INVCARD.DATEDOC~Date~2~~
EXCELSQL;select invcard.DOCNO AS "เลขที่เอกสาร", invcard.DATEDOC AS "วันที่เอกสาร",
EXCELSQL;invcard.ID AS "รหัสสินค้า", invmst.XDESC AS "ชื่อสินค้า",
EXCELSQL;invcard.QUAN AS "จำนวน", invcard.UNIT AS "หน่วยนับ", invcard.COST AS "ต้นทุน/หน่วย" ,
EXCELSQL;invcard.COSTAMT AS "มูลค่าต้นทุน", invcard.LOCID AS "รหัสคลัง", 
EXCELSQL;adjhead.FLAG AS "ชนิดการปรับปรุง",adjhead.XREMARK AS "รายละเอียด"
EXCELSQL;from invcard 
EXCELSQL;left join adjhead on invcard.DOCNO = adjhead.DOCNO
EXCELSQL;left join invmst on invcard.ID = invmst.ID 
EXCELSQL;where left(invcard.DOCNO,2) = "AJ"
EXCELSQL;order by invcard.DOCNO,invcard.DATEDOC,invcard.ID,invmst.XDESC
