Here is a 'Find Duplicates' report I run from Access. I am looking for all SalesID with a count greater than 1. Below is a sample of what I get.
SalesID Date Time REGION CC CITY BID BID2 BID3 BID4 FINAL
12345 04-Feb-07 02-01-07 GA US richmond ABC12 F 0 0 YES
12345 04-Feb-07 02-01-07 GA US richmond ABC12 F 0 5.01 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD F 0 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD3 F 0 19.06 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD4 F 0 4.17 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD5 F 0 50 NO
12345 04-Feb-07 02-01-07 GA US richmond ABCD6 F 0 3.04 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD7 F 0 3.03 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD8 F 0 3.09 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD8 F 0 3.06 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD8 F 0 3.02 NO
As you can see the BID field is producing duplicates. I don't want the duplicates. below is what I want it to look like.
SalesID Date Time REGION CC CITY BID BID2 BID3 BID4 FINAL
12345 04-Feb-07 02-01-07 GA US richmond ABC12 F 0 5.01 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD F 0 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD3 F 0 19.06 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD4 F 0 4.17 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD5 F 0 50 NO
12345 04-Feb-07 02-01-07 GA US richmond ABCD6 F 0 3.04 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD7 F 0 3.03 YES
12345 04-Feb-07 02-01-07 GA US richmond ABCD8 F 0 3.09 YES
I only want one instance of the BID when searching for duplicates on SalesID. All of the other columns don't interest me. This is driving me crazy. Below is the 'Find Duplicates' SQL i am using.
SELECT [SALES Report].SalesID, [SALES Report].Date, [SALES Report].Time, [SALES Report].REGION, [SALES Report].CC, [SALES Report].BID, [SALES Report].UID, [SALES Report].BID, [SALES Report].BID2, [SALES Report].BID4, [SALES Report].FINAL
FROM [SALES Report]
WHERE ((([SALES Report].SalesID) In (SELECT [SalesID] FROM [SALES Report] As Tmp GROUP BY [SalesID] HAVING Count(*)>1 )) AND (([SALES Report].Date) Between [From] And [To]))
ORDER BY [SALES Report].SalesID;
Help
Start Free Trial