REPORTFORM;IVC1.frf
TITLE;µé¹·Ø¹ÊÔ¹¤éÒ/Ë¹èÇÂ
SQL;DROP TABLE IF EXISTS _INVC1&
SQL;
SQL;CREATE TABLE _INVC1
SQL;SELECT INVCARD.ID, INVMST.XDESC, INVMST.UNIT, SUM(INVCARD.COSTREPBAL) AS XCOST, 
SQL;SUM(INVCARD.REPBAL) AS xBAL
SQL;FROM INVCARD
SQL;LEFT JOIN INVMST ON INVCARD.ID = INVMST.ID
SQL;WHERE (INVMST.XGROUP="01" OR INVMST.XGROUP="02")
SQL;and INVCARD.ID >= :M11 AND INVCARD.ID <= :M12
SQL;AND INVCARD.DATEDOC <= :M21
SQL;GROUP BY INVCARD.ID, INVMST.XDESC, INVMST.UNIT
SQL;ORDER BY INVCARD.ID&
SQL;
SQL;SELECT * FROM _INVC1
CONDITION;µÑé§áµèÃËÑÊÊÔ¹¤éÒ~INVMST.ID~Chr~2~SELECT ID FROM INVMST ~INV
CONDITION;ÊÔé¹ÊØ´ ³ ÇÑ¹·Õè~INVCARD.DATEDOC~Date~1~<=~
CONDITION;à§×èÍ¹ä¢~~TextFile~~STKBAL.TXT~
EXCELSQL;DROP TABLE IF EXISTS _INVC1&
EXCELSQL;
EXCELSQL;CREATE TABLE _INVC1
EXCELSQL;SELECT INVCARD.ID, INVMST.XDESC, INVMST.UNIT, SUM(INVCARD.COSTREPBAL) AS XCOST, 
EXCELSQL;SUM(INVCARD.REPBAL) AS xBAL
EXCELSQL;FROM INVCARD
EXCELSQL;LEFT JOIN INVMST ON INVCARD.ID = INVMST.ID
EXCELSQL;WHERE (INVMST.XGROUP="01" OR INVMST.XGROUP="02")
EXCELSQL;and INVCARD.ID >= :M11 AND INVCARD.ID <= :M12
EXCELSQL;AND INVCARD.DATEDOC <= :M21
EXCELSQL;GROUP BY INVCARD.ID, INVMST.XDESC, INVMST.UNIT
EXCELSQL;ORDER BY INVCARD.ID&
EXCELSQL;
EXCELSQL;SELECT 
EXCELSQL;ID AS Code, XDESC AS Description,
EXCELSQL;UNIT AS Unit, XBAL AS Amount,
EXCELSQL;(XCOST/XBAL) AS Cost,
EXCELSQL;((XCOST/XBAL)*(XBAL)) AS Amount
EXCELSQL; FROM _INVC1
USECROSSTAB;N
CROSSTABFRF;N
CROSSTABHEAD;
CROSSTABFIELD;
