if Sum ({@deptcnt}, {@pldept})=0 then 0 else
Thanks that did it. I was on the right track just couldn't get my syntax right.