SELECT * , SUM(b.Quantidade) as QUANT; FROM FICCARC a ; LEFT OUTER JOIN FICCARL b ; ON a.encomenda = b.encomenda ; LEFT OUTER JOIN FICMOLDE c ; ON a.terceiro = val(c.molde) ; WHERE a.encomenda=VAL(thisform.ncarga) ; GROUP BY b.Material ; Error: is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.If a put in the select one date field and in group the same field the sum is done by DATE and not by all records.