SELECT tbl_Departments.DepartmentID, tbl_Departments.DepartmentName, count(tbl_LabourDetails.DepartmentID ) as labour FROM tbl_LabourDetails RIGHT OUTER JOIN tbl_Departments ON tbl_LabourDetails.DepartmentID = tbl_Departments.DepartmentID
Column 'tbl_Departments.DepartmentID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
GROUP BY
GROUP BY tbl_Departments.DepartmentID, tbl_Departments.DepartmentName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)