well, looking at the time stamps, I think that most of us log on early in the day, and then we have to work, so...
It doesn't work because CR doesn't 'know' the total at the time that is it reading/filtering the data.
So how can we get around this? There is my easy answer, use a stored procedure to select your data, as you can filter easily in the stored proc. Due to causality, I can't think of a way to filter the data by joining straight to the tables....well how about this, I can't guarantee that it will work, but it should come close.
Using the command object, write a query that sums the values (like in your custom function) tied to the customer id, something like:
select customerid, ck = sum(case when account type = check then 99 else 1 end) from account table group by customerid.
now you can link your physical tables to the command object and filter all command object records to where the ck < 99 in the record selection formulas (i am assuming that if they have 3 saving accounts you would still want to see them...)
if nothing else, it might be a path to the final solution.
HTH