Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do display only the field which has multiple same value?

Status
Not open for further replies.

squirrelj

Technical User
Apr 21, 2001
2
US
I have a table with 2 fields (as below):

AccountOwner (AccountID,CustomerID)

Both the fields may have multiple values. To explain, a customer may have one or more accounts and an account may be owned by one or many customers (e.g. join a/c).

Here is what I want, how to do a query in Microsoft Access 2000 to just display a customer with more than one account where each account is on different branch?

There are many more tables. For above, I like mention another table called account
- one or many account is registered in one or many branches.

Hoping to hear some favourable response.

Thank you very much.
 
I don't see any mention of branch fields, but the simple form of it would be:

SELECT CustomerID, Count(*) AS NumOfAccts
FROM AccountOwner
GROUP BY CustomerID
HAVING Count(*) >1;

I also assume you would need a join to get the Customer name.

HTH

PsychPt@Hotmail.com
 
When you go to the Database Window, select the Queries tab, and click New, you'll see the New Query dialog box. In the list of wizards should be one called Find Duplicates Query Wizard. That will walk you through the steps to find duplicated values. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top