USE \\Svrpc-stlmnt01\e\Return-Items\banks>I have a SELECT that looks like this:
SELECT banks.bank AS bank2, ; > dis_exceptions.bankname, dis_exceptions.portfolio, dis_exceptions.bank, dis_exceptions.portfolio2, ; > SUM(dis_exceptions.tot_except) AS tot_except, dis_exceptions.newcompid, ; > SUM(dis_exceptions.EXC_DB) AS EXC_DB, SUM(dis_exceptions.EXC_DB_NUM) AS EXC_DB_NUM, ; > SUM(dis_exceptions.EXC_CR) AS EXC_CR, SUM(dis_exceptions.EXC_CR_NUM) AS EXC_CR_NUM, ; > SUM(dis_collections.tot_col) AS tot_col, SUM(dis_collections.nDebit) AS nDebit, ; > SUM(dis_collections.nDebit_num) AS nDebit_num, ; > SUM(dis_collections.nCredit) AS nCredit, SUM(dis_collections.nCreditnum) AS nCreditnum, ; > SUM(dis_ach.tot_ach) AS tot_ach, SUM(dis_ach.ACH_CR) AS ACH_CR, ; > SUM(dis_ach.ACH_CR_NUM) AS ACH_CR_NUM, ; > SUM(dis_ach.ACH_DB) AS ACH_DB, SUM(dis_ach.ACH_DB_NUM) AS ACH_DB_NUM, ; > SUM(dis_exemptions.tot_exempt) AS tot_exempt, SUM(dis_exemptions.EXEMPT_CR) AS EXEMPT_CR, ; > SUM(dis_exemptions.EXE_CR_NUM) AS EXE_CR_NUM, SUM(dis_exemptions.EXEMPT_DB) AS EXEMPT_DB, ; > SUM(dis_exemptions.EXE_DB_NUM) AS EXE_DB_NUM, ; > SUM(dis_revenue.tot_REV) AS tot_REV, SUM(dis_revenue.REV_CR) AS REV_CR, ; > SUM(dis_revenue.REV_CR_NUM) AS REV_CR_NUM, SUM(dis_revenue.REV_DB) AS REV_DB, ; > SUM(dis_revenue.REV_DB_NUM) AS REV_DB_NUM ; > FROM <b>banks</b> ; > LEFT JOIN dis_collections ; > ON banks.bank == dis_collections.bank ; > LEFT JOIN dis_ach ; > ON banks.bank == dis_ach.bank ; > LEFT JOIN dis_exemptions ; > ON banks.bank == dis_exemptions.bank ; > LEFT JOIN dis_revenue; > ON banks.bank == dis_revenue.bank ; > GROUP BY dis_exceptions.bank ; > INTO TABLE c:\dis_except_rpt1>