Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP's answer to COUNT(*) ??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
VFP's answer to COUNT(*) ??
Divers
Thread ID:
01338680
Message ID:
01338680
Vues:
51
Hi all,

I'm working with a client (still on VFP 8 for another month or so, unfortunately) who has the following SELECT statement choosing data from a VFP free table:
SELECT ALL ;
		SUM( Production.paidamt )   AS nPaidAmount ;
	FROM ( ADDBS( lcLocationProduction ) + [Persons] ) AS ProductionMaster ;
	INTO CURSOR curAmountsPrevious ;
	WHERE ProductionMaster.campaign = lcCampaign ;
		AND ProductionMaster.intype = lcType ;
		AND BETWEEN( TTOD( ProductionMaster.tcurdate ), ;
						curDates.dPreviousPledgesStart, ;
						ldPledgesStop ;
					) ;
		AND TTOD( ProductionMaster.paiddate ) <= ldPledgesStop ;
	GROUP BY intype
Now, they want to (quickly) add a count of the number of rows grouped to the SELECT statement (ie, "x" rows for this "intype" were what made up this "nPaidAmount" number). If this was SQL Server data, I'd do it with
COUNT(*) AS nPaidCount, ;
just above the SUM() statement.

However, I can't seem to find a comparable approach to the COUNT() function when querying against VFP tables. I've searched the message archives for the last three years of messages here, and didn't find anything.

Anybody got a quick idea on this one?

TIA,
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform