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
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