ifnull test added to quantity sold field