SELECT COUNT(tb_DeficiencyAssignment.col_DeficiencyAssignmentID) 
FROM        tb_Deficiency
LEFT JOIN   tb_Lot
ON          tb_Lot.col_Phase = tb_Deficiency.col_Phase
AND         tb_Lot.col_Centre = tb_Deficiency.col_Centre
AND         tb_Lot.col_Lot = tb_Deficiency.col_Lot
LEFT JOIN   tb_DeficiencyAssignment 
ON          tb_Deficiency.col_DeficiencyID = tb_DeficiencyAssignment.col_DeficiencyID
LEFT JOIN   tb_SentItem
ON          tb_DeficiencyAssignment.col_DeficiencyAssignmentID = tb_SentItem.col_DeficiencyAssignmentID
WHERE       tb_DeficiencyAssignment.col_CompletedDate = '0000-00-00'
AND tb_SentItem.col_DeficiencyAssignmentID IS NULL
AND tb_Deficiency.col_Centre LIKE '$var_Centre'
