Getting duplicate names inquery, how do i eliminate?

J

Judy

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?
 
B

bobgalway

That's what reports are for. Just build a report based on the query an
"group" it on your unique data
 
R

Randy Harris

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?
 
J

John Nurick

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
;
 
Top