REPORTFORM;VATS3_1.frf
TITLE;รายงานภาษีขาย ภายใน
SQL;drop table if exists _VATSS&
SQL;
SQL;create table _VATSS
SQL;select docno,arcard.accid, armst.xcomp as xdesc, arcard.INVAMT, arcard.VATAMT,datedoc
SQL;from arcard inner join armst on arcard.ACCID = armst.ACCID
SQL;where NOT (left(arcard.ACCID,3) >= 'SAB' AND left(arcard.ACCID,3) <= 'SAZ')
SQL;and datedoc >= :m11 and datedoc <= :m12&
SQL;
SQL;insert into  _VATSS
SQL;select docno,ordhead.accid, armst.xcomp as xdesc, ordhead.INVAMT, ordhead.VATAMT,datedoc
SQL;from ordhead inner join armst on ordhead.ACCID = armst.ACCID
SQL;where (left(ordhead.ACCID,3) >= 'SAB' AND left(ordhead.ACCID,3) <= 'SAZ')
SQL;and datedoc >= '2015-3-1'
SQL;and datedoc >= :m11 and datedoc <= :m12&
SQL;
SQL;select * from _VATSS order by datedoc,docno
CONDITION;ตั้งแต่วันที่~ARCARD.DATEDOC~Date~2~~
