I need to only print out one occurence of a name

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

Guest

MS Access:
I need to print out all of the names in my dBase and in some instances, the
name repeats but at different addresses. If a name is a duplicate, I only
want to print that particular name one time and one time only. It matters not
if the address is different from one name to another.
 
Do you need anything besides the name. In other words, do you want an address
also printed out?

Assuming you want one of the available addresses, you can try a total
(aggregate) query.

SELECT PersonName, First(Address) as AnAddress
FROM YourTable
GROUP BY PersonName

If you do this in the query grid.
Open the query in design view
Select View: Totals from the window. This will add a Total line to your query
grid and put "Group By" under all the fields you have chosen to display.
Change the total line under the Address field to First.
 
John Spencer (MVP) said:
Do you need anything besides the name. In other words, do you want an address
also printed out?

Assuming you want one of the available addresses, you can try a total
(aggregate) query.

SELECT PersonName, First(Address) as AnAddress
FROM YourTable
GROUP BY PersonName

If you do this in the query grid.
Open the query in design view
Select View: Totals from the window. This will add a Total line to your query
grid and put "Group By" under all the fields you have chosen to display.
Change the total line under the Address field to First.

John
Thank you! This is perfect! I tried it out before responding to the query if
the answer was helpful.
Thank you again, Chet
 
Back
Top