Solved

How do I delete duplicate rows in and access 2007 query using SQL?

Posted on 2009-04-07
2
389 Views
Last Modified: 2012-05-06
I have a query that is pulling from multiple tables.  I have some duplicate records on the VENDMAST1 table which is the AVVEND field.  With the query code I have now what woudl I have to change so that i dont get dupicate records from that field.  Thanks
SELECT BRENT_IVITMSP.ITITNM, BRENT_IVITMSP.ITITDS, BRENT_IVITMSP.ITORUM, BRENT_IVITMSP.ITSTLC, BRENT_IVITMSP.[ITVMF#], BRENT_VENDMAST1.AVNAME

FROM BRENT_IVITMSP INNER JOIN BRENT_VENDMAST1 ON BRENT_IVITMSP.[ITVND#] = BRENT_VENDMAST1.AVVEND

WHERE (((BRENT_IVITMSP.Itrecd)<>'D') AND ((BRENT_IVITMSP.ITSTCK)='Y'));

Open in new window

0
Comment
Question by:TriCountyIT
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 24087489
Just add the word Distinct after Select
0
 

Author Comment

by:TriCountyIT
ID: 24087588
That was easy.  Thanks a lot
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now