Ver Mensaje Individual
  #1  
Antiguo 26-10-2008
einarcito einarcito is offline
Miembro
 
Registrado: may 2008
Posts: 101
Reputación: 16
einarcito Va por buen camino
Problema con Query y tabla

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.

Última edición por marcoszorrilla fecha: 26-10-2008 a las 09:17:39.
Responder Con Cita