Progress Integer to Crystal Time

jc_acosta60

New Member
Hi to all,

I want your help to resolve this problem, I have some time searching the way to Convert a Progress Integer Field to Crystal Reports Time, could you help me with this?

Thanks in Advance for you help.
 
Unfortunately I have no idea about crystal time format, but the following snippet sheds a light on a progress integer containing a time value.

Code:
DEFINE VARIABLE i AS INTEGER    NO-UNDO.
i = TIME.
DEFINE VARIABLE h AS INTEGER    NO-UNDO.
DEFINE VARIABLE m AS INTEGER    NO-UNDO.
DEFINE VARIABLE s AS INTEGER    NO-UNDO.
/* Extracting hours */
h = TRUNC(i / 3600,0).
/* Extracting minutes */
m = TRUNC((i MOD 3600) / 60,0).
/* Extracting seconds */
s = i - h * 3600 - m * 60. 
MESSAGE PROGRAM-NAME(1) SKIP
   i SKIP
   h ":" STRING(m,"99") ":" STRING(s,"99") SKIP
   STRING(i,"HH:MM:SS")
   VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".

HTH
 
I want to thank you for your help, it was soo usefull the final answer based in your reply was:

numbervar tiempo := {tr_hist.tr_time};
numbervar horas;
numbervar minutos;
stringvar hora;
numbervar segundos;

horas := truncate(tiempo / 3600,0);
minutos := truncate((tiempo mod 3600) / 60,0);
segundos := tiempo - horas * 3600 - minutos * 60;

hora := totext(horas,0) & ":" & totext(minutos,0) & ":" & totext(segundos,0);

timevalue(hora);

Thank you again.
 
Back
Top