Exclude unique records

G

Guest

I am pretty new to Access and do not know a whole lot about code. I have a
report based on a query though, and I need to change it.

I need to exclude from this report records in which the data in a certain
field is unique to that record. For example, if I sell widgets to various
stores and each record represents an order from a store. I only want to see
orders from stores who have ordered from me multiple times on this report. I
do not want to see the orders of those stores who have only ordered from me
once. In other words, if a store appears in more than one record, I want to
see it's info on all of its orders. If a store only appears in one record, I
don't want to know anything about its orders.

Do I need to add something to my query or can I handle it through a filter
in the report properties? How? What is the language needed?

Thank you!
Katie
 
D

David Lloyd

Katie:

You can use the Find Duplicates Query Wizard to build a query to find
customers with multiple orders. You can then use the query as the Record
Source for your report. Basically, it involves using a subquery as shown
below.

SELECT CustomerID, ...
FROM MyTable
WHERE (((CustomerID) In (SELECT CustomerID FROM MyTable As Tmp GROUP BY
CustomerID HAVING Count(*)>1 )))

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I am pretty new to Access and do not know a whole lot about code. I have a
report based on a query though, and I need to change it.

I need to exclude from this report records in which the data in a certain
field is unique to that record. For example, if I sell widgets to various
stores and each record represents an order from a store. I only want to see
orders from stores who have ordered from me multiple times on this report.
I
do not want to see the orders of those stores who have only ordered from me
once. In other words, if a store appears in more than one record, I want to
see it's info on all of its orders. If a store only appears in one record,
I
don't want to know anything about its orders.

Do I need to add something to my query or can I handle it through a filter
in the report properties? How? What is the language needed?

Thank you!
Katie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top