Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create record counter by group
Message
From
17/11/2011 09:03:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01529015
Message ID:
01529125
Views:
41
>>>Hi All,
>>>
>>>May I know how to use the sql to count a record by grouping.
>>>example:
>>>
>>>Table A
>>>======
>>>Receipt DiscountDesc DiscountAmt
>>>1000 10% discount 10
>>>1000 20% discount 20
>>>1001 10% discount 10
>>>1002 50% discount 50
>>>1002 10% dsicount 10
>>>
>>>
>>>How to include the running number /counter in record by receipt group such as the output is:
>>>
>>>Receipt DiscountDesc DiscountAmt Counter
>>>1000 10% discount 10 1
>>>1000 20% discount 20 2
>>>1001 10% discount 10 1
>>>1002 50% discount 50 1
>>>1002 10% dsicount 10 2
>>>
>>>Thanks for your help in advance.
>>
>>Take a look at the message I just posted in the Report Designer section in the thread "Variable to count distinct number." What you need is a variation on what that poster needs. You use the same basic strategy, but change what you're counting.
>>
>>Tamar
>
>The main thing is, that it's very hard to get in the select statement in VFP8. Easier in VFP9 with projection.

You're right. I thought he wanted this in a report (no doubt because of the other message).

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform