It only works if you don't have deleted records in the table.
>This might run very slowly, but I it seems to work:
>
>SELECT SEX, count(sex) as iGroupCt, ;
> (COUNT(*) / RECCOUNT() * 100) AS nPct FROM folks ;
> GROUP BY sex ;
> ORDER BY nPct DESC
>
>You might store RECCOUNT() to a variable before the SQL-SELECT to avoid taking that hit:
>
>liRecCount = RECCOUNT()
>SELECT SEX, count(sex) as iGroupCt, ;
> (COUNT(*) / liRecCount * 100) AS nPct FROM folks ;
> GROUP BY sex ;
> ORDER BY nPct DESC
< SNIP >
--sb--