Ver Mensaje Individual
  #28  
Antiguo 02-03-2007
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.070
Reputación: 32
jhonny Va camino a la famajhonny Va camino a la fama
Si le quitamos unas cuantas lineas al principio también te funcionaria?:

Código Delphi [-]
   ADOQuery1.Active:= False;
   ADOQuery1.SQL.Text:= 'SELECT DISTINCTROW Factura.Fecha, Factura.Terminos, Sum(Factura.MntTotal) AS SumaDeMntTotal '+
                        ' FROM Factura '+
                        ' WHERE Factura.Fecha = :Fecha AND Factura.Terminos = :Termino '+
                        ' GROUP BY Factura.Fecha, Factura.Terminos ';
   ADOQuery1.Active:= True;
   ADOQuery1.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery1.Parameters[1].Value:= 'Contado';

   ADOQuery2.Active:= False;
   ADOQuery2.Active:= True;
   ADOQuery2.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery2.Parameters[1].Value:= 'Credito';

   ADOQuery3.Active:= False;
   ADOQuery3.SQL.Text:= 'SELECT DISTINCTROW PagosAdelanto.FechaTransac, Sum(PagosAdelanto.MontoCompra) AS [Suma De MontoCompra], Sum(PagosAdelanto.Abono) AS [Suma De Abono] '+
                        ' FROM PagosAdelanto'+
                        ' WHERE PagosAdelanto.FechaTransac = :FechaTransac'+
                        ' GROUP BY PagosAdelanto.FechaTransac ';
   ADOQuery3.Active:= True;
   ADOQuery3.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery4.Active:= False;
   ADOQuery4.SQL.Text:= 'SELECT DISTINCTROW BancoNac.FechaTransac, Sum(BancoNac.Retiros) AS [Suma De Retiros], Sum(BancoNac.Depositos) AS [Suma De Depositos] '+
                        ' FROM BancoNac'+
                        ' WHERE BancoNac.FechaTransac = :FechaTransac'+
                        ' GROUP BY BancoNac.FechaTransac ';
   ADOQuery4.Active:= True;
   ADOQuery4.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery5.Active:= False;
   ADOQuery5.SQL.Text:= 'SELECT DISTINCTROW BancoSanJoseco.FechaTransac, Sum(BancoSanJoseco.Retiros) AS [Suma De Retiros], Sum(BancoSanJoseco.Depositos) AS [Suma De Depositos] '+
                        'FROM BancoSanJoseco'+
                        ' WHERE BancoSanJoseco.FechaTransac = :FechaTransac'+
                        ' GROUP BY BancoSanJoseco.FechaTransac ';
   ADOQuery5.Active:= True;
   ADOQuery5.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery6.Active:= False;
   ADOQuery6.SQL.Text:= 'SELECT DISTINCTROW BancoSanJosedol.FechaTransac, Sum(BancoSanJosedol.Retiros) AS [Suma De Retiros], Sum(BancoSanJosedol.Depositos) AS [Suma De Depositos] '+
                        ' FROM BancoSanJosedol'+
                        ' WHERE BancoSanJosedol.FechaTransac = :FechaTransac'+
                        ' GROUP BY BancoSanJosedol.FechaTransac ';
   ADOQuery6.Active:= True;
   ADOQuery6.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery7.Active:= False;
   ADOQuery7.SQL.Text:= 'SELECT DISTINCTROW CxPDetalle.FechaPago, CxPDetalle.TipoTransac, Sum(CxPDetalle.Monto) AS [Suma De Monto] '+
                        ' FROM CxPDetalle'+
                        ' WHERE CxPDetalle.FechaPago = :FechaPago AND CxPDetalle.TipoTransac ="PA" '+
                        ' GROUP BY CxPDetalle.FechaPago, CxPDetalle.TipoTransac';
   ADOQuery7.Active:= True;
   ADOQuery7.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   ADOQuery8.Active:= False;
   ADOQuery8.SQL.Text:= 'SELECT DISTINCTROW CxCDetalle.FechaCobro, CxCDetalle.TipoTransac, Sum(CxCDetalle.Monto) AS [Suma De Monto] '+
                        ' FROM CxCDetalle'+
                        ' WHERE CxCDetalle.FechaCobro = :FechaCobro AND CxCDetalle.TipoTransac ="PA" '+
                        ' GROUP BY CxCDetalle.FechaCobro, CxCDetalle.TipoTransac';
   ADOQuery8.Active:= True;
   ADOQuery8.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/

Última edición por jhonny fecha: 02-03-2007 a las 23:31:47.
Responder Con Cita