On 20 February 2016 at 19:53, jerry foote jerryf@footegroup.com wrote:
I have adjusted the code as below and still get error message GROUP BY clause is missing or invalid. I am running vp8
SELECT manifest_n, bill_of_la, release_no, frm_acct, source, source_id, sum(units) as totat FROM SERVICE WHERE manifest_n=2512 AND bill_of_la="158401" GROUP BY release_no INTO CURSOR mytotla
It's because these fields are not in the GROUP BY: manifest_n, bill_of_la, frm_acct, source, source_id
Technically your SQL is invalid, but older versions of Fox allowed this.
Try: GROUP BY manifest_n, release_no, bill_of_la, frm_acct, source, source_id
Or use aggregates in the SELECT: SELECT MAX(release_no), MAX(bill_of_la), release_no, MAX(frm_acct), MAX(source), MAX(source_id), sum(units) as totat