Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 15-10-2015
mjjj mjjj is offline
Miembro
 
Registrado: mar 2007
Posts: 652
Poder: 20
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
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
TimeStamp = TimeStamp me da error Chogo Firebird e Interbase 7 16-03-2011 04:13:38
TIMESTAMP en restriccion Cañones SQL 6 28-08-2007 23:19:27
timestamp y milisegundos Abel Garcia Firebird e Interbase 1 19-09-2005 01:45:06
timestamp y milisegundos ya...... Abel Garcia Firebird e Interbase 0 17-09-2005 07:17:38
Timestamp y bde 5.2 Toni Firebird e Interbase 2 27-05-2003 09:26:33


La franja horaria es GMT +2. Ahora son las 13:36:57.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi