>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...
>
>Thanks,
>
>Dennis
select sum(iif(color='red',1,0)) as red, sum(iif(color='green',1,0)) as green, coun(*) as allcolors from therainbow
Doru