hola chicos tengo un problemita, estoy con un sistema de ventas el cual necesito hacer una suma de los subtotales de todas las lineas de ventas y el resultado colocarlo en un Tedit. Lo q estoy haciendo es esto. Nose si tiene algun sentido para uds.
Código Delphi
[-]with dm.qpagar do begin
active:=false;
sql.Clear;
sql.Add('SELECT sum(subtotal) as total from ventaActual ');
active:=true;
qpagar:= fieldbyname('total').asVariant;
editTotal.Text:=dm.qpagar;
los errores q me da son:
[Error] UnitVentas.pas(227): Undeclared identifier: 'qpagar'
[Error] UnitVentas.pas(228): Incompatible types: 'String' and 'TQuery'
[Fatal Error] sistema.dpr(25): Could not compile used unit 'UnitVentas.pas'
fundamentalmente el compilador me marca en esta linea
qpagar:= fieldbyname('total').asVariant;
Gracias.