select DEPTNO,POSHEAD,VIPNO,CUSTNAME,sum(ARS)as SARS,sum(COSTS) as SCOSTS,sum(CASH+VISA) as SPAYED,sum(DISMONEY) as SDISM from DP000 where FORMDATE <='20150731' and ISCONFIRM='Y' group by DEPTNO,POSHEAD,VIPNO,CUSTNAME
