P
Pele
I am working with a Brand Table and I need to ensure that
none of the entries in the Brand ID or Brand Name should
be repeated i.e. if any one of these fields are repeated,
I need to identify the records.
I used the "Find Duplicates Query Wizard" and below is the
SQL. The problem is that this query seems to only try to
identify records where the Brand ID and Brand Name are
duplicated for the records, but I am interested in whether
in situations where even one of these fields are
duplicated.
What do I need to do.
SELECT [Temp_1Brand Distribution].[Brand ID], [Temp_1Brand
Distribution].[Brand Name], [Temp_1Brand Distribution].
[Distribution Count]
FROM [Temp_1Brand Distribution]
WHERE ((([Temp_1Brand Distribution].[Brand ID]) In (SELECT
[Brand ID] FROM [Temp_1Brand Distribution] As Tmp GROUP BY
[Brand ID],[Brand Name] HAVING Count(*)>1 And [Brand
Name] = [Temp_1Brand Distribution].[Brand Name])))
ORDER BY [Temp_1Brand Distribution].[Brand ID],
[Temp_1Brand Distribution].[Brand Name];
none of the entries in the Brand ID or Brand Name should
be repeated i.e. if any one of these fields are repeated,
I need to identify the records.
I used the "Find Duplicates Query Wizard" and below is the
SQL. The problem is that this query seems to only try to
identify records where the Brand ID and Brand Name are
duplicated for the records, but I am interested in whether
in situations where even one of these fields are
duplicated.
What do I need to do.
SELECT [Temp_1Brand Distribution].[Brand ID], [Temp_1Brand
Distribution].[Brand Name], [Temp_1Brand Distribution].
[Distribution Count]
FROM [Temp_1Brand Distribution]
WHERE ((([Temp_1Brand Distribution].[Brand ID]) In (SELECT
[Brand ID] FROM [Temp_1Brand Distribution] As Tmp GROUP BY
[Brand ID],[Brand Name] HAVING Count(*)>1 And [Brand
Name] = [Temp_1Brand Distribution].[Brand Name])))
ORDER BY [Temp_1Brand Distribution].[Brand ID],
[Temp_1Brand Distribution].[Brand Name];