Member
140
Points
|
Replied on
27 Oct 2014 11:25 PM IST
Hi Kalyan,
You can use the below query to show the department wise employees count.
SELECT d.DeptID, d.DeptName, ISNULL(Count(e.EmpID),0) AS Employees FROM tbl_Dept
d with (nolock) LEFT JOIN
tbl_Emp e with (nolock) ON d.DeptID = e.DeptID GROUP BY
d.DeptID, d.DeptName
If you want t add to total count in FOOTER, you sum all the grid rows, and can display in footer. Hope this will helps.
Venkat
|