The following query gives me the following result.Code Type Total 143 INFORMATION 1117 ENVIRONMENTAL 1117 ENVIRONMENTAL 2117 ENVIRONMENTAL 1117 ENVIRONMENTAL 1I Want Distinct values like this:Code Type Total 143 INFORMATION 1117 ENVIRONMENTAL 5SELECT incident.rep_type_fk, report_type.rep_type, report_type.type_desc, incident.assigned_to_date, COUNT(*) AS countTotal, SUM(Count(*)) over() AS countTotalSum FROM incident LEFT OUTER JOIN report_type ON incident.rep_type_fk=report_type.id_pk WHERE incident.assigned_to_date Between @BegDate AND @EndDate GROUP BY incident.rep_type_fk,report_type.rep_type,report_type.type_desc,incident.assigned_to_date ORDER BY incident.rep_type_fk
Thanks in advance!