View Full Version : Only show lowest cust ID per account


stevefishwickuk
11-03-2006, 06:34 AM
Hello,

I have searched through the forum, but cannot find a suitable answer to my question, so here I am.

I wonder if you could help me?

I have a list of Customers each of which has a Customer ID then I have a list of accounts which may have more than one customer ID.

For this senerio I would like to only show the record that has the lowest customer ID.

I.E. If one account has two customers take the lowest customer ID.

Does anyone know how to do this in SQL or VBA?

Thanks for all your help.

KeithG
11-03-2006, 06:40 AM
Use an SQL query and hit the totals button on the toobar so that the totals row is displayed in the query designer grid. Then group by account number and use min on the customer id field.

stevefishwickuk
11-03-2006, 07:48 AM
Worked a treat, thanks.