Ver Mensaje Individual
  #6  
Antiguo 15-10-2015
mjjj mjjj is offline
Miembro
 
Registrado: mar 2007
Posts: 652
Reputación: 18
mjjj Va por buen camino
Finalmente lo resolví con el siguiente código en evento onGetText del campo del query.

Código Delphi [-]
procedure Tform.IBQuery1REGISTROGetText(Sender: TField;
  var Text: string; DisplayText: Boolean);
var dias, horas, minutos, segundos: integer;
begin
if sender.AsString <> '' then
begin
segundos := sender.AsInteger;

dias := segundos div 86400;
segundos := segundos - dias * 86400;

horas := segundos div 3600;
segundos := segundos - horas * 3600;

minutos := segundos div 60;
segundos := segundos - minutos * 60;

if dias > 0 then text := inttostr(dias)+'d';
if horas > 0 then text := text + ' '+inttostr(horas)+'h';
if minutos > 0 then text := text + ' '+inttostr(minutos)+'m';

if text = '' then
if segundos > 0 then text := '<1m';
end;
end;

Gracias y saludos.
Responder Con Cita