Getting duplicate names inquery, how do i eliminate?

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

Guest

I did a query with name, employee number, and multiple id numbers. The
employee name field is showing duplicate names and i only want it show once
with the id numbers as many fields below it. I tried doing the properties,
unique records and/or values to yes but it still showing...what other methods
can i employ to make this not duplicate name?
 
Judy said:
I did a query with name, employee number, and multiple id numbers. The
employee name field is showing duplicate names and i only want it show once
with the id numbers as many fields below it. I tried doing the properties,
unique records and/or values to yes but it still showing...what other methods
can i employ to make this not duplicate name?


If I understand what you are asking, there is no way to do that in a query.
A query will output all of the unique records and since the ID number is
unique, each will be a unique record. You can suppress the display of
duplicated names in a report, however.

John Doe 3614
4231
5738
Bill Smith 4529
5736
9392

You could get this sort of output. Is that what you had in mind?
 
Hi Judy,

As others have said, you should probably do this in a report and not in
a query. But it's possible in a query, like this (assumes table Judy,
with fields EmpName, EmpID and ID):

SELECT
IIF(A.ID = (SELECT MIN(B.ID) FROM Judy AS B
WHERE B.EmpName = A.EmpName),
A.EmpName,
NULL) As fEmpName,
A.EmpID,
A.ID
FROM Judy AS A
ORDER BY A.EmpName, A.ID
;
 

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