Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the SUM function in VFP 8.0 SQL code
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00888074
Message ID:
00888144
Vues:
37
I think the odd behaviour you are seeing will disappear if you use a having clause rather than a where clause for the sum criteria. I find that where clauses don't do well with criteria that require an aggregate.

Try this:
SELECT ;
		APTRXFIL.VOUCHER_NO, ;
		APTRXFIL.INV_AMT, ;
		SUM(APTRXDST.DST_AMT) AS DST_AMT ;
	FROM ;
		APTRXFIL, ;
		APTRXDST ;
	WHERE ;
		APTRXFIL.VOUCHER_NO = APTRXDST.VOUCHER_NO ;
        HAVING ;
		APTRXFIL.INV_AMT <> SUM(APTRXDST.DST_AMT) ;
	GROUP BY ;
		APTRXFIL.VOUCHER_NO, ;
		APTRXFIL.INV_AMT ;
	INTO CURSOR tmpAPTransactions
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform