REPORTFORM;IV3.frf
TITLE;รายงานใบกำกับภาษีแยกตามลูกค้า
SQL;select invcard.DATEDOC, invcard.ID, invcard.XDESC,
SQL;invcard.QUAN, invcard.UNIT, invcard.PRICE, invcard.DISCL,arcard.INVAMT,arcard.DUEDATE,
SQL;invcard.AMOUNT_L, arcard.VATAMT, arcard.DISCD, arcard.AMOUNT_D,
SQL;invcard.DOCNO, arcard.SALEID, arcard.ACCID, armst.XCOMP,
SQL;jobmst.JDESC, arcard.JOBNO, salemst.SNAME,
SQL;if(arcard.NBAL= 0 ,"Y","N") as EXP
SQL;from invcard 
SQL;left join invmst on invcard.ID = invmst.ID
SQL;left join arcard on invcard.DOCNO = arcard.DOCNO
SQL;left join armst on invcard.ACCID = armst.ACCID
SQL;left join salemst on invcard.SALEID = salemst.SID
SQL;left join jobmst on invcard.JOBNO = jobmst.JOBNO 
SQL;where left (invcard.DOCNO,2) = "IV"
SQL;order by arcard.ACCID, invcard.DATEDOC, invcard.DOCNO
CONDITION;ตั้งแต่รหัสลูกค้า~INVCARD.ACCID~Chr~2~SELECT ACCID FROM ARMST ~AR
CONDITION;ตั้งแต่วันที่~INVCARD.DATEDOC ~Date~2~~
