REPORTFORM;IV12.frf
TITLE;รายงานยอดขาย แยกลูกค้า/เอกสาร
SQL;select 
SQL;invcard.DOCNO,
SQL;invcard.DATEDOC,
SQL;arcard.ACCID,
SQL;invcard.ID,
SQL;invcard.XDESC,
SQL;armst.XCOMP,
SQL;armst.ADD_1,
SQL;armst.ADD_2,
SQL;armst.TEL,
SQL;armst.FAX,
SQL;invcard.QUAN,
SQL;invcard.UNIT,
SQL;invcard.PRICE,
SQL;invcard.DISCL,
SQL;invcard.AMOUNT_L,
SQL;arcard.VATAMT,
SQL;arcard.AMOUNT_B,
SQL;arcard.DISCAMT,
SQL;arcard.AMOUNT_D
SQL;from invcard inner join arcard on invcard.DOCNO = arcard.DOCNO
SQL;left join armst on arcard.ACCID = armst.ACCID
SQL;left join invmst on invcard.ID = invmst.ID
SQL;where left(arcard.TRTYPE,2) = 'AR' 
SQL;order by arcard.accid,invcard.docno,invcard.line
CONDITION;ตั้งแต่รหัสลูกค้า~INVCARD.ACCID~Chr~2~SELECT ACCID FROM ARMST~AR
CONDITION;ตั้งแต่วันที่~INVCARD.DATEDOC~Date~~~
