>I need to count the number of occurrences of certain field values...
>
>i.e.
>
>field ... color
>
>I need to get a count of records with values red, green, blue, etc.
>
>then a total of all records...
>
>I found a cube function which works with sql server but foxpro doesn't seem to like it...
>
>Is there another way to do this in foxpro...
You could use the following:
select color, count(*) as Color_Cnt from mytable group by color into cursor c_temp
If you don't have any deleted records in your table, you could use reccount('mytable'). If you have deleted records, just perform another query on the results of the first query:
select sum(color_cnt) from c_temp into array latemp
latemp[1] will hold the total of all the counted colors.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao