Okay I added this but the results are coming out not like how I want them. Here's the querySELECT doc, COUNT(*) AS cntFROM ( Select doc FROM pendingdds pjoin Offices.dbo.OfficeCodes don d.officecode = p.docwhere d.typecode='7' and d.reportsto='F03' and (Datediff(DAY, filedate, Getdate()) > 250 ) Group By doc, clms ) AS Tgroup by t.docunionSELECT doc, COUNT(*) AS cntFROM ( Select doc FROM pendingdds pjoin Offices.dbo.OfficeCodes don d.officecode = p.docwhere d.typecode='7' and d.reportsto='F03' and (Datediff(DAY, filedate, Getdate()) > 300 ) Group By doc, clms ) AS TGROUP BY doc
These results are coming out as:doc cnts23 6s23 2
How can I get it to come out this way:doc 250 300s23 6 2