Your SQL won't work too. You need all unaggregated fields in the GROUP BY clause to make it valid. Earlier VFP versions were forgiving with this. Think about it: What should be put into the result, if you don't specify, what value of the group of records you want? A random record? VFP8 got ANSI conform and more precise.
As a fast solution you can SET ENGINEBEHAVIOR 70, but in the long run better rethink your SQL. Here's a sample on how to transform SQL. This is not the only way, there are of course many ways.
Bye, Olaf.
Main Topics
Browse All Topics





by: ralmadaPosted on 2009-09-04 at 14:14:27ID: 25263393
You cannot use *. You basically cannot include any column that is not contained in either the aggregated function or the group by statement.
try like this:
SELECT parent, sum(qty) as qty_sum from tab1 GROUP BY parent