Duplicates - how to remove in a query

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

Guest

I am generating a query that gives names, addesses, etc. However, I would
like to remove duplicates based on SSN. How can I do this?
 
Calire,

Create your query in design view like you normally would, without
worrying about the duplicates, then go View > Totals in the menu. Notice
the new line whic appears in the grid, headed Total Function, and
defaulted Group By in all fields.
This should do the job, unless you have different names or addresses in
different records for the same SSN, in which case you will continue to
get multiple records. You could overcome this by changing group by to
first or last in the fields where you have different values, but this is
just sweeping the dust under the rug. The real problem is you should
only have one record per person in a persons table, with the SSN as the
primary key, and then whatever other table requires a person field,
should only have an SSN field, with a join to the same field in the
persons table. This way you avoid repeating data, and all the problems
that go with it like different name spellings or obsolete addresses etc.

HTH,
Nikos
 
Back
Top