Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question
Message
 
To
07/07/1999 14:05:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00238418
Message ID:
00238563
Views:
12
Ken, you can use two simple sql commands to get this done as follows:

select custno, cnt(*) as prchasecnt ;
from purchases ;
group by custno into cursor PurCntCurs

select ;
sum(iif(between(prchasecnt,1,5), 1, 0)) as pur_1_5,;
sum(iif(between(prchasecnt,6,10), 1, 0)) as pur_6_10,;
sum(iif(between(prchasecnt,11,15), 1, 0)) as pur_11_15,;
sum(iif(between(prchasecnt,16,20), 1, 0)) as pur_16_20,;
sum(iif(prchasecnt>21, 1, 0)) as pur_20_over ;
from PurCntCurs
Michael Garcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform