AnsweredAssumed Answered

Counting customers in the same County

Question asked by Stu412 on Feb 12, 2015
Latest reply on Feb 13, 2015 by philmodjunk

Title

Counting customers in the same County

Post

I'd imagine this is pretty simple but today I cannot get it to work!

I have an address table and for normalization purposes a County table hooked into it.  The address table has the foreign key of the county next to each customer's address.  Hants = 10, Surrey = 11 and so on.

What I need to do is count how many customers, including the one I'm looking at, are in the same county.  This info is to be shown 1) on a general report (Hants = 33 Customers) and 2) on a customer record (Total other customers in your county excluding yourself = 32).

Taking the Hants example, I need to run down the address table and (in my twisted logic) Count If (CountyID = 'The Customer's Own County ID'.  Or something similar.

Please excuse the incomprehensible ramblings, it's been a long two days.....

Thanks

Outcomes