Ver Mensaje Individual
  #2  
Antiguo 07-09-2006
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
No se si te sirva pero esto es un codigo de un reporte que usa dos query en el para hacer enlaces.

if Reporte = 'PiezasFacturadas' then
begin
ShortDateFormat := 'mm/dd/yyyy';
//#
try
FEntregasP:=TFEntregasP.Create(self);
FEntregasP.ADOQuery1.SQL.Add(' WHERE Factura.Fecha >= #'+DateToStr(DTP1.Date)+ '# AND Factura.Fecha <= # '+DateToStr(DTP2.Date)+'#');
FEntregasP.ADOQuery1.SQL.Add(' AND Factura.Excento = True ');
FEntregasP.ADOQuery1.SQL.Add(' ORDER BY Factura.Fecha DESC, Factura.CodFactura DESC ');
// con este (Showmessage) veo lo que me envia el query antes de enseñar el reporte
//Showmessage(QRMovBanNac.ADOQuery1.SQL.Text);
FEntregasP.ADOQuery2.SQL.Add(' WHERE Factura.Fecha >= #'+DateToStr(DTP1.Date)+ '# AND Factura.Fecha <= # '+DateToStr(DTP2.Date)+'#');
FEntregasP.ADOQuery2.SQL.Add(' AND Factura.Excento = True ');
FEntregasP.ADOQuery2.SQL.Add(' ORDER BY Factura.Fecha DESC, Factura.CodFactura DESC ');
FEntregasP.ADOQuery1.Open;
FEntregasP.ADOQuery2.Open;
ShortDateFormat := 'dd/mm/yyyy';
FEntregasP.ShowModal;
finally
FEntregasP.Free;
end;
Tal vez te de alguna idea.
Saludos
Responder Con Cita