TR Time

Chris Kelleher

Administrator
Staff member
Hi Peggers,
I have been asked to add a sort to the Transaction by part report(3.21.14) to include time, and show the time im the report. I looked in tr_hist for the item tr_time and the format is integer. When I listed the tr_hist, and displayed the time, i saw numbers from 8 to 59,682, and others of the like. Is there a translation process in MFG/Pro that takes this number converts it into a time? this is in 8.6e. Any suggestions? Thanks.


David L. Knowles
Database Administrator
Captive Plastics, Inc
Partners in Plastics Packaging
 

Chris Kelleher

Administrator
Staff member
The field tr_time contains the number of seconds since the start of the day
(i.e. 1 AM is 3600). You can use it as is to sort on, and change your
display statement to somethine like string(tr_time,"HH:MM:SS")
label 'time'
 

Chris Kelleher

Administrator
Staff member
Long Form:
v_hrs = trunc(59682 / 3600),0)
v_mins = trunc(((59682 mod 3600) / 60), 0)
v_secs = 59682 mod 60
v_time = string(v_hrs,"99:") + string(v_mins,"99:") + string(v_secs,"99").

or Short Form
v_time = string(59682,"HH:MM:SS").
 

Chris Kelleher

Administrator
Staff member
This is a Progress issue, not related to MFG/Pro. Time is represented as number of
seconds since midnight (0 to 86399). In fact the TIME function is of integer type.
To translate it (or any integer) to time format, use the STRING function, with
"HH:MM:SS" or the like. Look up TIME in the Language Reference for more info.

You'd still want to sort by the number itself, though.
---------------
Paul T. O'Leary
Evco Plastics, a leader in plastics injection molding
DeForest, WI USA
 
Top