Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Charts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Charts
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01339306
Message ID:
01339333
Vues:
12
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform