REPORTFORM;CH5.frf
TITLE;รายงานเช็คจ่ายเรียงตามวันที่ผ่านเช็ค
SQL;drop table if exists _chkpay&
SQL;
SQL;create table _chkpay
SQL;select bktr.CHKNO, bktr.DOCNO, bktr.APACCID,bktr.DATEDOC,bktr.DOCGL,
SQL;apmst.XCOMP, bktr.BANKID, bank.BANKNAME,
SQL;bktr.AMT_OUT, if(bktr.CLRCHK = 0,"N","Y") as XCRLCHK,
SQL;bktr.DATEPASS, bktr.DOCGL as DOCGL_1, bktr.DATECHK
SQL;from bktr
SQL;left join apmst on bktr.APACCID = apmst.ACCID
SQL;left join bank on bktr.BANKID = bank.BANKID
SQL;where bktr.TRTYPE = "AP" AND bktr.CLRCHK = 1 AND left(bktr.PAYTYPE,2) = '02'
SQL;and BKTR.DATEPASS >= :m11 and BKTR.DATEPASS <= :m12
SQL;order by bktr.DATEPASS, bktr.DATECHK, bktr.CHKNO&
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 DATEPASS, DATECHK, CHKNO
CONDITION;วันที่ผ่านเช็ค~BKTR.DATEPASS~Date~2~~
EXCELSQL;drop table if exists _chkpay&
EXCELSQL;
EXCELSQL;create table _chkpay
EXCELSQL;select bktr.CHKNO, bktr.DOCNO, bktr.APACCID,bktr.DATEDOC,bktr.DOCGL,
EXCELSQL;apmst.XCOMP, bktr.BANKID, bank.BANKNAME,
EXCELSQL;bktr.AMT_OUT, if(bktr.CLRCHK = 0,"N","Y") as XCRLCHK,
EXCELSQL;bktr.DATEPASS, bktr.DOCGL as DOCGL_1, bktr.DATECHK
EXCELSQL;from bktr
EXCELSQL;left join apmst on bktr.APACCID = apmst.ACCID
EXCELSQL;left join bank on bktr.BANKID = bank.BANKID
EXCELSQL;where bktr.TRTYPE = "AP" AND bktr.CLRCHK = 1 AND left(bktr.PAYTYPE,2) = '02'
EXCELSQL;and BKTR.DATEPASS >= :m11 and BKTR.DATEPASS <= :m12
EXCELSQL;order by bktr.DATEPASS, bktr.DATECHK, bktr.CHKNO&
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 DATEPASS, DATECHK, CHKNO
USECROSSTAB;N
CROSSTABFRF;N
CROSSTABHEAD;
CROSSTABFIELD;
