REPORTFORM;PO2.frf
TITLE;รายงานแสดงรายละเอียดใบสั่งซื้อ
SQL;select po.ID, po.XDESC, po.QUAN, po.UNIT_SAL, po.PRICE,
SQL;po.DISCL, po.AMOUNT_L, po.DOCNO, po.DATEDOC,
SQL;pohead.ACCID, apmst.XCOMP, pohead.DPTID, pohead.AMOUNT_D,
SQL;pohead.VATAMT, pohead.DISCD, pohead.discamt, po.prno
SQL;from po
SQL;left join pohead on po.DOCNO = pohead.DOCNO
SQL;left join invmst on po.ID = invmst.ID
SQL;left join apmst on pohead.ACCID = apmst.ACCID
SQL;where left(po.DOCNO,2)="PO"
SQL;and pohead.VOID = 0
SQL;order by po.DOCNO, po.DATEDOC, po.ID, invmst.XDESC 
CONDITION;ตั้งแต่เลขที่เอกสาร~PO.DOCNO~Chr~2~SELECT DOCNO FROM PO~
CONDITION;ตั้งแต่วันที่~PO.DATEDOC~Date~2~~
EXCELSQL;select po.ID, po.XDESC, po.QUAN, po.UNIT_SAL, po.PRICE,
EXCELSQL;po.DISCL, po.AMOUNT_L, po.DOCNO, po.DATEDOC,
EXCELSQL;pohead.ACCID, apmst.XCOMP, pohead.DPTID, pohead.AMOUNT_D,
EXCELSQL;pohead.VATAMT, pohead.DISCD, pohead.discamt, po.prno
EXCELSQL;from po
EXCELSQL;left join pohead on po.DOCNO = pohead.DOCNO
EXCELSQL;left join invmst on po.ID = invmst.ID
EXCELSQL;left join apmst on pohead.ACCID = apmst.ACCID
EXCELSQL;where left(po.DOCNO,2)="PO"
EXCELSQL;and pohead.VOID = 0
EXCELSQL;order by po.DOCNO, po.DATEDOC, po.ID, invmst.XDESC 
USECROSSTAB;N
CROSSTABFRF;N
CROSSTABHEAD;
CROSSTABFIELD;
