Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seconds Conversion

Status
Not open for further replies.

williadn48

Programmer
Oct 27, 2006
29
US
I am a real new newbie to CR. I want to make sure this is an accurate formula.

START....
numberVar vol;
numberVar secs;
numberVar productivity;

vol := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Imgv_Imgs}, {sp_get_Operator_Stats_ByDate_More_Than_One;1.operatorid});
secs := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Imgv_Secs}, {sp_get_Operator_Stats_ByDate_More_Than_One;1.operatorid});

if secs <> 0 and vol <> 0 then
productivity := vol/((secs/60)/60)
else
productivity := 0;


numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(productivity/60)/60);
min := Remainder(Truncate(productivity/60),60);
sec := Remainder(productivity,60);

hhmmss := totext(hrs,"00") + ":" + totext(min,"00");
STOP.....

I am concerned about the vol / secs calc is correct. Is the calc being divided by seconds or hours? I need hours.
 
Hours.

But then below you incorrectly use productivity in yoiur hours/min/secs calcs...

Use secs there instead of productivity.

Not sure why you elected to use volume/hours in those computations...I was the one that gave you the formulas, and that was not what was demonstrated.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top