Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count customer
Message
 
 
To
25/11/2002 23:05:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00726794
Message ID:
00726798
Views:
16
>i have a table that has 2 coulms one is order date and the other is customer id i want to know how many orders a customer did with out cuonting more than one order per day for example if in one day he hs more then one order i want to count only one i did select ord_date,cus_id from my table group by 1,2 and i still get more than one record for a custumer per date

Try
* Eliminate day duplicates
SELECT DISTINCT OrderDate, CustomerID ;
  FROM table1 ;
  INTO CURSOR crsTemp
* Count orders
SELECT CustomerID, COUNT(*) ;
  FROM crsTemp ;
  INTO CURSOR crsResult
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform