on 2014 Dec 09 11:39 PM
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};
Request clarification before answering.
Hi Paul,
Try this please:
shared timevar startTime;
shared timevar endTime;
shared numbervar CalTime;
shared numbervar interval;
if {EMPHISTL1.EMTRNC} in ['REL','EBC','EBV','EBA','BOM','BOO','BSB'] and {EMPHISTL1.EMPDPT} in ['422','2']
then
startTime:= {EMPHISTL1.EMTRT};
if {EMPHISTL1.EMTRNC} = 'ECT'
then
endTime := {EMPHISTL1.EMTRT};
interval := startTime - endTime; //time in seconds
NumberVar Hours := Truncate (interval/3600);
NumberVar Minutes := Truncate (Remainder (interval,3600)/60);
NumberVar Seconds := Remainder (interval,60) ;
Totext (Hours,0,"") + ':'+ Totext (Minutes,0,"") + ':' + Totext(Seconds,0,"")
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
29 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.