Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

eliminate duplicates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
holly - 18 May 2007 15:55 GMT
I have a table with 7 different columns of team members on different teams.  
I need a count of all team members.  How do I query seven different columns
and eliminate dups?
Douglas J. Steele - 18 May 2007 16:11 GMT
You've discovered yet another problem with denormalized tables. If you have
7 different columns, each containing the same basic information, you have a
repeating group.

If you can't go back and redesign your tables, the easiest approach would be
to create a UNION query that normalizes the data so that it's in only 1
column:

SELECT Member1 AS Member
FROM MyTable
UNION
SELECT Member2 AS Member
FROM MyTable
UNION
SELECT Member3 AS Member
FROM MyTable
UNION
SELECT Member4 AS Member
FROM MyTable
UNION
SELECT Member5 AS Member
FROM MyTable
UNION
SELECT Member6 AS Member
FROM MyTable
UNION
SELECT Member7 AS Member
FROM MyTable

Since you're using the UNION statement, all duplicates will be eliminated,
so that the resultant query will return a list of unique members.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I have a table with 7 different columns of team members on different teams.
> I need a count of all team members.  How do I query seven different
> columns
> and eliminate dups?
holly - 18 May 2007 16:28 GMT
Thank you!

> You've discovered yet another problem with denormalized tables. If you have
> 7 different columns, each containing the same basic information, you have a
[quoted text clipped - 32 lines]
> > columns
> > and eliminate dups?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.