with Modulo.Busqueda do begin
If active then close;
SQL.Clear;
SQL.Add('SELECT V.id_venta, V.fecha_venta, V.total_venta, P.descripcion,');
SQL.Add('DV.precio_unitario, DV.cantidad_vendida ');
SQL.Add('FROM venta V');
SQL.Add('join Detalle_Venta DV on V.ID_Venta = DV.ID_Venta');
SQL.Add('join Productos P on DV.Id_Producto = P.ID_Producto');
SQL.Add('WHERE V.fecha_venta between :FechaIni and :FechaFin');
SQL.Add('order by V.id_venta');
ParamByName('Fechaini').AsDateTime := unDateTimePickerIni.DateTime;
ParamByName('FechaFin').AsDateTime := unDateTimePickerFin.DateTime;
Open;
end;