Ver Mensaje Individual
  #1  
Antiguo 28-10-2011
sabueso1010 sabueso1010 is offline
Miembro
NULL
 
Registrado: jul 2011
Posts: 31
Reputación: 0
sabueso1010 Va por buen camino
Talking Error con Sql Group By

Hola foro, tengo el siguiente codigo y me marca el error que muestro al final de este tema

Código Delphi [-]
filtro:='SELECT codigo, fecharec, facturafolio, fecha_vence, cobrarcodigo, cobrarnombre, moneda, sum(total), sum(abonos), sum(saldo), total, abonos, saldo, estado from '+#34+qtabla+#34+' where estado = '+quotedstr('FACTURADO');

if rg3.itemindex=1 then filtro:=filtro+' and cobrarcodigo  = '+#34+edit1.text+#34;
if rg3.itemindex=2 then filtro:=filtro+' and cobrarcodigo  = '+#34+edit1.text+#34+' and moneda = "PESOS" ';
if rg3.itemindex=3 then filtro:=filtro+' and cobrarcodigo  = '+#34+edit1.text+#34+' and moneda = "DOLARES" ';
filtro:=filtro+' Group by facturafolio ';

with data.qfacturas do begin
  close;
  SQL.Clear;
  SQL.Add(filtro);
  open;
end;

Error mostrado en tiempo de ejecucion
class edbenginneerror with message " when GROUP BY exists,
every simple field in projectors must be in GROUP BY."
Responder Con Cita