Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collect information based on a month
Message
 
À
16/11/2008 17:21:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01362189
Message ID:
01362191
Vues:
9
>What would be a good way to do a SQL query if I have a date field in my table and I want to gather informations based on the months. I mean there could be data in the month of november 2008 but also november 2007.
>
>How can I manage to get the sum for november 2007 and then november 2008 all in the same query?
SELECT YEAR(Date)  AS nYear,;
       MONTH(Date) AS nMonth,;
       SUM(....)   AS SomeTotal;
FROM YourTable;
GROUP BY 1,2;
INTO CURSOR crsTest
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform