REPORTFORM;RC1.frf
TITLE;รายงาน รายละเอียดการซื้อสินค้า
SQL;DROP TABLE IF  EXISTS _XRC1&
SQL;
SQL;CREATE TABLE _XRC1
SQL;select invcard.DATEDOC, invcard.DOCNO, invcard.ID,
SQL;invcard.XDESC, invcard.QUAN,
SQL;invcard.PRICE, invcard.DISCL, invcard.AMOUNT_L,
SQL;apcard.ACCID, apmst.XCOMP, apcard.DUEDATE, apcard.TAXNO,
SQL;apcard.DISCD, apcard.VATAMT, apcard.AMOUNT_D, invcard.UNIT,
SQL;invcard.LINE,
SQL;000000000.00 AS XAMT
SQL;from invcard 
SQL;left join invmst on invcard.ID = invmst.ID 
SQL;left join apcard on invcard.DOCNO = apcard.DOCNO 
SQL;left join apmst on apcard.ACCID = apmst.ACCID
SQL;where left (invcard.DOCNO,2) = "RC" and
SQL;invcard.DOCNO >= :m11 and invcard.DOCNO <= :m12 
SQL;and invcard.DATEDOC >= :m21 and invcard.DATEDOC <= :m22 
SQL;order by invcard.DOCNO,invcard.DATEDOC, invcard.LINE&
SQL;
SQL;UPDATE _XRC1 SET XAMT = AMOUNT_D WHERE LINE = 1&
SQL;
SQL;SELECT * FROM _XRC1
CONDITION;ตั้งแต่เลขที่เอกสาร~INVCARD.DOCNO ~Chr~2~SELECT DOCNO FROM INVCARD WHERE LEFT(DOCNO,2) = "RC"~
CONDITION;ตั้งแต่วันที่~INVCARD.DATEDOC~Date~2~~
USECROSSTAB;N
CROSSTABFRF;N
CROSSTABHEAD;
CROSSTABFIELD;
