Try something along the following lines:SELECT a.div ,a.subreg ,a.dis ,a.ter ,SUM(b.finalcount) AS finalcount ,COUNT(DISTINCT z.contractid) AS accumulatedcount ,COUNT(y.contractid) AS terminationsFROM maSales a LEFT JOIN ( HomeBaseLink x JOIN pMW b ON x.contractid = b.repcontractid AND b.[level] = 2 AND x.startweekno <= b.weekno -- should this be x.endweekno >= b.weekno ???? AND (x.endweekno > b.weekno OR x.endweekno IS NULL) ) ON a.ter = x.homebasename AND a.weekno = b.weekno LEFT JOIN HBL z ON a.ter = z.homebasename AND z.startweekno <= a.weekno AND (z.endweekno >= a.weekno OR z.endweekno IS NULL) LEFT JOIN ( HBL y JOIN rpContract rp ON y.contractid = rp.contractid JOIN rpt_weeknotodate w ON rp.contractenddate >= w.startdate AND rp.contractenddate < w.enddate ) -- is a.territory different from a.ter??? ON a.territory = y.homebasename AND y.startweekno <= a.weekno AND (y.endweekno >= a.weekno OR y.endweekno IS NULL) AND a.weekno = w.yearweeknoWHERE a.weekno BETWEEN 200901 AND 200926GROUP BY a.div, a.subreg, a.dis, a.ter