counting unique values in query

J

Joe

Hello,
Thanks a lot for any help!

I have a query with sales details of products. The 'Name'
field of the query repeats itself once everytime the
product is sold. That is, u have the same product name as
many records.
I want to display in a Form, the number of times each
product has been sold.
I have a combo box with the list of products and I want to
display the number of times each products have been sold
in a text box.
Eg: Product sold to
aa customer 1
bb customer 3
aa customer x
cc customer 1
aa customer 3
bb customer 2
I have a combo box with the list of products. how can I
display the number of time they have been sold??

Thanks,
Regards,
Joe
 
J

JaRa

Hi, is this what you are looking for?

SELECT Product, Count(Product) FROM YourTable GROUP BY Product

- Raoul
 
J

Joe

Hi, thanks for the suggesiton..but it doesnt work..when I
add the statement to the query in the SQL view, it gives
out errors..or may be I misinterpreted your ´code..I am
pretty new to Access..so can u plz help me..
i wasn to display the number of times each product is
present
Thanks,
Reg,
Joe
 
J

JaRa

did you change the names to the ones of your table?

what's the table name and its field names?

- Raoul
 
J

Joe

Hello again!
the name of the table is 'sales analysis'
the field with the product names repeating is called 'Model'.
Now, I want to display the number of time sthese items have been listed.
Thanks and regards,
Joe
 
J

JohnFol

So using Raoul's suggestion, just substitute in your names, ie

SELECT Model, Count(Model) FROM [Sales Analysis] GROUP BY Model
 

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