Ver Mensaje Individual
  #3  
Antiguo 17-11-2007
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.740
Reputación: 26
ContraVeneno Va por buen camino
Código Delphi [-]
with DMKIOSCO.QRTODASXDIA do begin
 IF Active then Close;
 SQL.Clear;
 SQL.Add ('SELECT SUM((precio_publico  - precio_costo)* cantidad) as Cantidad,SECTOR');
 SQL.Add('FROM VENTA');
 SQL.Add('WHERE FECHA between :vFechaDesde and :vFechaHasta');
 SQL.Add('and (sector = "GOLOSINAS" OR sector = "CIGARRILLOS")');
 SQL.Add('GROUP BY SECTOR');
 Params[0].AsDatetime   := vFechaDesde;
 Params[1].AsDatetime   := vFechaHasta;
 Open;
 UnValidateEdit.AsCurrency := FieldByName('Cantidad').AsCurrency; 
 //O tambien:
 UnEdit.AsString := FieldByName('cantidad').AsString;

 ...
end;  //with
__________________

Responder Con Cita