Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Summing Billed and Collected
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Summing Billed and Collected
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01512706
Message ID:
01512706
Vues:
119
I am supposing it is not possible to sum billed and collected amounts within the same SQL statement using separate date fields, one for billed date and the other for deposit date., or is it? This is what I have so far, but haven't pursued the separate dates ads I am not sure how that could be done, unless maybe I did a UNION with two separate SQL statements preceding the UNION.

I need to do a WHERE condition on the date range for January 2010 on the DEPOS_DATE field, however, that might not be able to be combined with the current where condition below. It seems that separate statements are needed.


SELECT "January 2010" AS Month_Year, GrpID, Emp_ID, SUM(bill_prem) as Month_Billed, ;
BnftName, SUM(Cash_Paid) AS Month_Collected ;
FROM tmp1 ;
WHERE BETWEEN(bill_date, CTOD("01/01/2010"), CTOD("01/31/2010"));
INTO CURSOR tmp2 ;
GROUP BY GrpID, Emp_ID, BnftName
(/pre>
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform