How do you know WHICH TaxID Vendor# combination to keep? The one that appears
the most times, the lowest Vendor#, etc. This may be one of those problems
where you are going to have to apply the human brain. If you have some rule to
decide then we can try to develop a solution.
To identify those taxIds with more than one Vendor#. You might be able to do
this in qone query if you hadn't used special characters (#) in your field name.
SELECT TaxID, Vendor
FROM YourTable
WHERE YourTable.TaxID IN
(
SELECT DRecs.TaxID
FROM
(SELECT Distinct TaxID, Vendor
FROM YourTable) as DRecs
GROUP BY DRecs.TaxID
HAVING COUNT(DRecs.TaxID) > 1)
Since you did you will need to build stacked queries solution and you may end up
with a query that is not updatable.
QueryOne: Named DRecs
SELECT Distinct TaxID, [Vendor#] as Vendor
FROM YourTable
QueryTwo: Named MultiVendor
SELECT TaxID
FROM DRecs
GROUP BY TaxID
HAVING Count(TaxID)>1
QueryThree:
SELECT TaxID, [Vendor#]
FROM YourTable INNER JOIN MultiVendor
ON YourTable.TaxID = MultiVendor.TaxID
OR Try
SELECT TaxID, [Vendor#]
FROM YourTable
WHERE TaxID in
(SELECT TaxId FROM MultiVendor)