Paul,
There's no aggregating function like sum(quantity) and you need to group by everything that isn't an aggregating function.
Basically older VFP style "group by" clauses will not work in SQL Server nor in VFP9 because it's become more SQL standards compliant.
>Hello,
>
>In Northwind database for orderdetails table:
>
>SELECT orderid,productid,quantity as quantity FROM orderdetails GROUP BY productid ORDER BY productid,orderid
>
>Why always give an error ?
>
>SQL: group by clause missing or invalid
>
>TIA