Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Values in a recordset
Message
 
 
To
28/03/2001 10:27:55
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00489422
Message ID:
00489443
Views:
11
>Thank-you I have considered this but what do you do when you have 10-50 fields that need counting? Passing back the SQL statement 50 times could cause the report output to take and excessive amount of time to produce wouldn't it?

Another approach if you want to limit the number of SQL response is to use SUM() and the VFP IIF() function. Here is an example:
select sum(iif(field1 = value,1,0)) as cntField1, ;
   sum(field2 = value,1,0)) as cntField2 from test into cursor c_temp
If you have a lot of fields, the length of the SQL statement may be too large to send in one pass but you could break it up into smaller chunks.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform