Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP's answer to COUNT(*) ??
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VFP's answer to COUNT(*) ??
Miscellaneous
Thread ID:
01338680
Message ID:
01338680
Views:
52
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?
Next
Reply
Map
View

Click here to load this message in the networking platform