Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An SQL Rollup Question
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
An SQL Rollup Question
Miscellaneous
Thread ID:
01076555
Message ID:
01076555
Views:
50
Let's a say that I have a simple table that has columns WIDGETNAME, SALEDATE. The task is to create a table with columns WIDGETNAME, SALESPERMONTH, RUNNINGTOTAL. A requirement is that months with zero sales are to be included in the final tally. So for a given widget, the final table might look like this:
Note:  SPM=sales per month
Item         Month  SPM RunningTot
THISWIDGET  2005/01 002 002
THISWIDGET  2005/02 001 003
THISWIDGET  2005/03 010 013
THISWIDGET  2005/04 000 013
THISWIDGET  2005/05 002 015
This is not particularly onerous to do with some VFP code (and an application of INDEX UNIQUE that I like to use) layered on top of some SQL. But I was wondering if anybody has an SQL-only solution for this? It seems this would be a commonly requested type of summary. Thanks very much.
Next
Reply
Map
View

Click here to load this message in the networking platform