Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Charts
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Charts
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01339306
Message ID:
01339333
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>So, I would like a SQL code to create a small tempCursor containing: a field tempCursor.sum from financial.price
>and tempCursor.month from financial.date
SELECT cMonth(Date) AS Month, SUM(Price) AS Sum ;
   FROM Financial ;
 GROUP BY Month(Date) ;
 INTO CURSOR TempCursor
Is the financial data going to had dates that span multiple years? IF so you would need to add a where clause for filtering for only the year you want.
SELECT cMonth(Date) AS Month, SUM(Price) AS Sum ;
   FROM Financial ;
WHERE Year(Date) = 2008 ;
 GROUP BY Month(Date) ;
 INTO CURSOR TempCursor
By grouping on Month instead of cMonth you will get the data ordered by chronological months rather than alphebetical months.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform