Ver Mensaje Individual
  #7  
Antiguo 21-08-2012
Avatar de martini002
martini002 martini002 is offline
Miembro
 
Registrado: may 2012
Ubicación: Puerto Ordaz - Venezuela
Posts: 175
Reputación: 15
martini002 Va por buen camino
Mira lo resolvi, no como queria pero igual me funciona muy bien
inclusive mejor, hice esto mira:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
Var
  Suma:Integer;
begin
if StrToInt(Edit1.Text)>0 then
  ZQueryBD.Close;
  ZQueryBD.SQL.Clear;
  ZQueryBD.SQL.Text:= 'Insert Into Factura (Articulo, Precio) Select Articulo, Precio From Inventario Where Codigo = '+Edit1.Text;
  ZQueryBD.Open;
  ZQueryBD.Close;
  ZQueryBD.SQL.Clear;
  ZQueryBD.SQL.Text:= 'Select * From Factura';
  ZQueryBD.Open;
  ZQuery1.Close;
  ZQuery1.SQL.Clear;
  ZQuery1.SQL.Text:=  'Select Sum(Precio) as Suma From Factura';
  ZQuery1.Open;
  Edit3.Text:= ZQuery1.FieldByName('Suma').AsString+' BsF';
end;


Gracias
Responder Con Cita