Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Top 12 records ???
Message
 
 
To
22/08/2012 13:50:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01551046
Message ID:
01551048
Views:
53
>I have a cursor with the following three fields: Part, Month (YYYYMM) and Sales.
>
>The combination of Part + Month is unique, as that has been previously calculated, and there are no records for months where Sales = 0
>
>I need to calculate the sum of sales for the first twelve months that occur in this cursor for each part, answering the question "For each part, what is the total sales for the first twelve months in which sales occurred, recognizing that they might not be consecutive?".
>
>Is there a way to do this in a single statement?

This is very simple in SQL Server 2005 and up, but quite complex in VFP. It was discussed here before.

See Re: SPT Syntax Thread #1548842 Message #1548907
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform