SELECT count(*)
FROM tb_ListCompany
LEFT JOIN tb_DeficiencyAssignment
ON tb_DeficiencyAssignment.col_CompanyName = tb_ListCompany.col_CompanyName and col_CompletedDate='0000-00-00'
LEFT JOIN tb_Deficiency
ON tb_Deficiency.col_DeficiencyID = tb_DeficiencyAssignment.col_DeficiencyID
WHERE tb_ListCompany.col_UserID = '$var_User'
AND tb_Deficiency.col_Centre LIKE '$var_Centre'