REPORTFORM;CHKPASS3_1.frf
TITLE;รายงานผ่านเช็ค ตามรหัสธนาคาร วันที่ผ่านเช็ค (แบบที่2)
SQL;drop table if exists _chkpay&
SQL;
SQL;create table _chkpay
SQL;select bktr.DATECHK, bktr.CHKNO, bktr.DOCNO,
SQL;bktr.DATEDOC, bktr.BANKID, bank.BANKNAME, bktr.AMT_IN, 
SQL;bktr.amt_in-bktr.AMT_OUT as amt_out, bktr.DOCGL, bktr.DATEPASS,
SQL;IF(bktr.CLRCHK = 1,"ผ่าน","N") AS STATUS,
SQL;IF(left(bktr.trtype,2)="AP",bktr.APACCID,ARACCID) AS APACCID,
SQL;IF(left(bktr.trtype,2)="AP",apmst.XCOMP,armst.xcomp) as xcomp
SQL;from bktr 
SQL;left join bank on bktr.BANKID = bank.BANKID
SQL;left join apmst on bktr.APACCID = apmst.ACCID
SQL;left join armst on bktr.ARACCID = armst.ACCID
SQL;where bktr.CLRCHK = 1 and left(bktr.PAYTYPE,2) = '02'
SQL;and bktr.bankid >= :m11 and bktr.bankid <= :m12
SQL;and bktr.datepass >= :m21 and bktr.datepass <= :m22
SQL;order by bktr.BANKID, bktr.DATEPASS,bktr.DATECHK&
SQL;
SQL;update _chkpay inner join cashpay on _chkpay.docno = cashpay.docno
SQL;set _chkpay.xcomp = cashpay.xremark&
SQL;
SQL;select * from _chkpay order by BANKID, DATEPASS, DATECHK
CONDITION;ตั้งแต่รหัสธนาคาร~BKTR.BANKID~Chr~2~SELECT BANKID FROM BANK ~BANK
CONDITION;วันที่ผ่านเช็ค~BKTR.DATEPASS~Date~2~~
EXCELSQL;drop table if exists _chkpay&
EXCELSQL;
EXCELSQL;create table _chkpay
EXCELSQL;select bktr.DATECHK, bktr.CHKNO, bktr.DOCNO,
EXCELSQL;bktr.DATEDOC, bktr.BANKID, bank.BANKNAME, bktr.AMT_IN, 
EXCELSQL;bktr.amt_in-bktr.AMT_OUT as amt_out, bktr.DOCGL, bktr.DATEPASS,
EXCELSQL;IF(bktr.CLRCHK = 1,"ผ่าน","N") AS STATUS,
EXCELSQL;IF(left(bktr.trtype,2)="AP",bktr.APACCID,ARACCID) AS APACCID,
EXCELSQL;IF(left(bktr.trtype,2)="AP",apmst.XCOMP,armst.xcomp) as xcomp
EXCELSQL;from bktr 
EXCELSQL;left join bank on bktr.BANKID = bank.BANKID
EXCELSQL;left join apmst on bktr.APACCID = apmst.ACCID
EXCELSQL;left join armst on bktr.ARACCID = armst.ACCID
EXCELSQL;where bktr.CLRCHK = 1 and left(bktr.PAYTYPE,2) = '02'
EXCELSQL;and bktr.bankid >= :m11 and bktr.bankid <= :m12
EXCELSQL;and bktr.datepass >= :m21 and bktr.datepass <= :m22
EXCELSQL;order by bktr.BANKID, bktr.DATEPASS,bktr.DATECHK&
EXCELSQL;
EXCELSQL;update _chkpay inner join cashpay on _chkpay.docno = cashpay.docno
EXCELSQL;set _chkpay.xcomp = cashpay.xremark&
EXCELSQL;
EXCELSQL;select * from _chkpay order by BANKID, DATEPASS, DATECHK
USECROSSTAB;N
CROSSTABFRF;N
CROSSTABHEAD;
CROSSTABFIELD;
