>What do I have wrong with my group by clause below? When I try this in VFP 8.0 I get the message “SQL: Group By clause is missing or invalid”.
>
>SELECT item,((SUM(price * qtyshp) - SUM(cost * qtyshp)) / SUM(price * qtyshp)) * 100 AS Margin;
> FROM Prodata!artran99 ;
>UNION ALL;
>SELECT item,((SUM(price * qtyshp) - SUM(cost * qtyshp)) / SUM(price * qtyshp)) * 100 AS Margin;
> FROM Prodata!arytrn99 ;
>group BY item ;
>into cursor tcCursor
Jeff,
I think the GROUP BY clause has to come before the UNION clause.
HTH,
Jim