G
Guest
I have a query that returns duplicates based on two variables.
Inmate#
Product
What I need is if the Inmate has 4 or more of the same item then it gives me
the results, it if is less than or =3 then it does not display them in the
query.
Can this be done.
Here is my code.
SELECT tblProperty.[Inmate#], tblProperty.Product, tblProperty.ID,
tblProperty.Quantity, tblProperty.Date, tblProperty.Description,
tblProperty.[Order#], tblProperty.[Serial#]
FROM tblProperty
WHERE (((tblProperty.[Inmate#]) In (SELECT [Inmate#] FROM [tblProperty] As
Tmp GROUP BY [Inmate#],[Product] HAVING Count(*)>1 And [Product] =
[tblProperty].[Product])))
ORDER BY tblProperty.[Inmate#], tblProperty.Product;
Inmate#
Product
What I need is if the Inmate has 4 or more of the same item then it gives me
the results, it if is less than or =3 then it does not display them in the
query.
Can this be done.
Here is my code.
SELECT tblProperty.[Inmate#], tblProperty.Product, tblProperty.ID,
tblProperty.Quantity, tblProperty.Date, tblProperty.Description,
tblProperty.[Order#], tblProperty.[Serial#]
FROM tblProperty
WHERE (((tblProperty.[Inmate#]) In (SELECT [Inmate#] FROM [tblProperty] As
Tmp GROUP BY [Inmate#],[Product] HAVING Count(*)>1 And [Product] =
[tblProperty].[Product])))
ORDER BY tblProperty.[Inmate#], tblProperty.Product;