Count Duplicates Once

P

Paula

A query contains the fields CustomerID, CustomerName, OrderID, OrderDate and
ItemID.
The query is based on a customers table, orders table, and order details
table. The orders table has a foreign key of CustomerID and is joined to
CustomerID in the customer table. The order details table has a foreign key
of OrderID and is joined to OrderID in the orders table. The number of
records in the query is determined by the total number of items in all the
orders. Of course, each record in the query contains OrderID. When I convert
the query to a totals query and do a Count on the OrderID field by Customer
and Year of OrderDate, the number I get is the same as the number of items
because each record in the query contains OrderID. How can I do a count so
that where there are duplicate OrderIDs, that OrderID is only counted once?
Is there a CountDistinct, DistinctCount or some such?

Thanks!

Paula
 
E

Ed Robichaud

You can set the query properties to either show unique records or unique
values (or neither). Open your query in design mode, select (F4) view
properties, select the either of the "unique" property rows then press F1 to
view Access help on this subject.
-Ed
 

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

Similar Threads

Crosstab Query 2
Database Design 4
Ambiguous outer joins 1
Updateable Query To List Products Ordered 5
Add <ALL> to combo box 9
Enforcing item uniqueness 1
Query leaving out some data 2
LINQ & SCOPE_IDENTITY 4

Top