Hi,
>SELECT COUNT(*) from myTable WITH (Buffering=.T.) where myTabble.key ='123' GROUP BY type
>INTO CURSOR pTempTable
You code looks valid. However, WITH Buffering is a feature that has been introduced in VFP 9. If you are a using an older version you would either need to update, or use a non-SQL solution such as COUNT FOR.
--
Christof