counting unique values in query

  • Thread starter Thread starter Joe
  • Start date Start date
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
 
Hi, is this what you are looking for?

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

- Raoul
 
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
 
did you change the names to the ones of your table?

what's the table name and its field names?

- Raoul
 
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
 
So using Raoul's suggestion, just substitute in your names, ie

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