It's a bug in VFP which doesn't allow to use subquery with GROUP BY clause. As a workaround you can split your query into two steps.
>Hello,
>
>The following sql command generates a "command is missing required clause" error. Can anyone help me??? Thanks!!!
>
>SELECT * from tempAgg INTO CURSOR cuAgg WHERE date in (select DISTINCT TOP 2 date FROM tempAgg WHERE quarter = cPquart ORDER BY date)
>
>
>- tb
--sb--