Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get UNIQUE Data?

Status
Not open for further replies.

anhfuego1

MIS
Jul 13, 2005
13
US
I created a query to capture how many UNIQUE customers there would be in a given time frame. A single customer may have multiple orders. I created a parameter query to capture the time frame.

How would I get the total count of UNIQUE customers?

Table: Orders Field: Cust_ID and Ord_Date

Is it a 'group by' issue?

Any help is greatly appreciated!
 
try this:

SELECT Cust_ID, COUNT(*) as totalOrders
FROM Orders
GROUP BY CUST_ID

-DNG
 
SELECT Count(*) AS CountOfCustomers
FROM (SELECT DISTINCT Cust_ID FROM Orders
WHERE Ord_Date Between your time frame) AS D

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top