Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summarization of a table
Message
From
06/04/2002 07:38:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00641649
Message ID:
00641767
Views:
13
>Hi everybody,
>Is there a way to quickly summarize the values of a table into a cursor based on something, in this case the partno.
>
>The structure of table is Date D, Commodity C(30), Suppid C(10), Partno C(17), def_0199 I, def_0299 I, def_0399 I, def_0499 I, etc.
>
>Lets say that I want a summarization of four (4) partno's, I want to return the identical structure expect that it would contain only the summarized data for the four partno's.
>
>Thanks,
>Joseph Schaff

Check the GROUP BY clause of the SELECT - SQL command. This one will combine several records in one. Use sum(MyField) as TotalMyField to sum individual fields within each group.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform