Counting Question

  • Thread starter Thread starter fireytech
  • Start date Start date
F

fireytech

I need to be able to count how many different vendorID's are in a
list. The list will contain duplicates of each vendorid so the query
has to be able to ignore duplicates and look at the list and say there
are 2 vendors involved.

For example:

Record# VendorID
1 3207
2 3207
3 3207
4 4654
5 2333
6 3207
7 4654

The answer would be 3 as there are only 3 different id's involved.
How in the world do I make this happen in a query?
 
When you are in the QBE designing your query, display the Properties dialog
box for your query (right click in the area where tables are displayed and
select Properties) then change the "Unique Values" property to Yes.
 
I tried both above ideas and here are the results. The query now
shows me 2 rows (for this data there are only 2 vendorID's involved)
so it is correct to this point. I tried to do the count function
using the sum button but it gives me 15 for each vendorID becuase they
both have 15 different line entries. Now, how do I get a "count" that
will give me a numeric answer of "2"?
 
When you have your query producing the correct values (two records) just
click the Totals button and count the record ID and group by the other fields.
 
Back
Top