REPORTFORM;AJ5_E.frf
TITLE;ADJUST INFORMATION BY JOB,DATE 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;invcard.SALEID, salemst.SNAME,
SQL;invcard.JOBNO, jobmst.JDESC,
SQL;adjhead.ADJCODE, adjcode.ADJDESC
SQL;from invcard
SQL;left join adjhead on invcard.DOCNO = adjhead.DOCNO
SQL;left join invmst on invcard.ID = invmst.ID 
SQL;left join salemst on invcard.SALEID = salemst.SID
SQL;left join jobmst on invcard.JOBNO = jobmst.JOBNO
SQL;left join adjcode on adjhead.ADJCODE = adjcode.ADJCODE
SQL;where left(invcard.DOCNO,2) = "AJ"
SQL;order by invcard.JOBNO, invcard.ID,invmst.XDESC,invcard.DATEDOC, invcard.DOCNO  
CONDITION;FROM JOB NO~INVCARD.JOBNO~Chr~2~SELECT JOBNO FROM JOBMST~JOB
CONDITION;FROM STOCK ID~INVCARD.ID~Chr~2~SELECT ID FROM INVMST~INV
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
