Something like this:SELECT SUM(case When dbo.tbl_1.CaseActive = 0 and Coalesce(dbo.tbl_2.Case_Forwarded,0) = 0 then 1 else 0 end) AS Qty, SUM(case when dbo.tbl_1.CaseActive = 0 and Coalesce(dbo.tbl_2.Case_Forwarded,0) = 1 then 1 else 0 end) AS Qty2FROM dbo.tbl_1 INNER JOIN dbo.tbl_2 ON dbo.tbl_1.ReportID = dbo.tbl_2.ReportIDWHERE dbo.tbl_1.DateReported BETWEEN '20060101' AND '20080101'
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"