Skip to Content
0
Former Member
Dec 09, 2014 at 11:39 PM

how to calculate the time spent producing the order ?

37 Views

Here what I am trying to do is calculate the time so that if the EMTRNC is one of these codes, it is when the worker started to work on the order and the time we have as EMTRT. then we have the end time if the code is ECT which has a time also. the end time of the task. I have code to calculate hours from these minutes but how would you do the basic subtract here? and at which point?

shared numbervar TotalMin:=TotalMin;

shared numbervar endtime:=0;

shared numbervar CalTime:= CalTime;

if {EMPHISTL1.EMTRNC} in ('REL' 'EBC' 'EBV' 'EBA' 'BOM' 'BOO' 'BSB')

and {EMPHISTL1.EMPDPT} in '422' '2'

then

TotalMin:= {EMPHISTL1.EMTRT};

//

if {EMPHISTL1.EMTRNC} = 'ECT'

then

endtime:= {EMPHISTL1.EMTRT};