Ver Mensaje Individual
  #9  
Antiguo 02-03-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 27
Caral Va por buen camino
Hola
Gracias jhonny
Asi Quedo:
Código Delphi [-]
procedure TFReporteDiario.DTP1Change(Sender: TObject);
begin
   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 = "Contado" '+
                        ' GROUP BY Factura.Fecha, Factura.Terminos ';
    ADOQuery1.Active:= True;
    ADOQuery1.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));
   // esta opcion tambien sirve
  //  ADOQuery1.Parameters.ParamByName('fecha').value := StrToDate(DateToStr(DTP1.Date));
  //  ADOQuery1.Parameters.ParamByName('fecha').DataType:=ftDate ;
    ADOQuery2.Active:= False;
   ADOQuery2.SQL.Text:= 'SELECT DISTINCTROW Factura.Fecha, Factura.Terminos, Sum(Factura.MntTotal) AS SumaDeMntTotal '+
                        ' FROM Factura '+
                        ' WHERE Factura.Fecha = :Fecha AND Factura.Terminos = "Credito" '+
                        ' GROUP BY Factura.Fecha, Factura.Terminos ';
    ADOQuery2.Active:= True;
    ADOQuery2.Parameters[0].Value:= StrToDate(DateToStr(DTP1.Date));

   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));

end;
Si no se ve bien, por favor arreglenlo.
Roman, jhonny, vtdeleon, delphi.com.ar y todos muchas gracias
Saludos
Responder Con Cita