View Single Post
  #4  
Old March 19th, 2010, 11:40 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Select unique products per customer?

I need to have a list of what products they bought with each customer
listed only once.
You have to have the customer for each of their purchased product otherwise
you would not know which product goes with a customer.
You can produce a report and set the Hide Duplicates property to Yes for
that text box.

--
Build a little, test a little.


"Jim" wrote:

I need the records in a table because it's for a customer lookup on a
website that's not attached to the original data source. When I run the
query you suggest, it gives me multiple entries for every product they've
ordered. So if a customer orders 10 different products, it lists the same
customer 10 times. I need to have a list of what products they bought with
each customer listed only once.
Thanks

Jim

"KARL DEWEY" wrote in message
...
Putting them in a table is the wrong thing to do as it will be out of date
the next time something is ordered.
Just use this query each time --
SELECT CustomerID, Product
FROM YourTable
GROUP BY CustomerID, Product;

--
Build a little, test a little.


"Jim" wrote:

Looking at the Northwind database as an example, I need to take all the
products from the Orders table and put them into one field in a table for
each customer so that I end up with each customer and the products
they've
ordered in row with no duplicate products for each customer. Thanks for
any
help/suggestions.



Jim


.



.