Removing duplicate rows in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a database that is pretty large and everything is based off a site
location.

i am running a query where i have users first name, last name, email address
and site location. but some of the users are at multiple sites.

how do i create a query to not show duplicate contacts for the user?
 
Remove site location from the fields that are returned.

Or use a query that returns only one site per individual - Which one do you
want?

SELECT FirstName, LastName, Email, First(Location) as SomeLocation
FROM YourTable
GROUP BY FirstName, LastName, Email

Or perhaps
SELECT FirstName, LastName, Email, Max(Location) as SomeLocation
FROM YourTable
GROUP BY FirstName, LastName, Email

In the query grid,
-- select View: Totals from the menu.
-- Change GROUP BY to First, Last, Max, or Min under the Location field
-- Leave the other Group By as Group By

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top