williadn48
Programmer
I need to divide volume by hours to get a productivity total.
The number of scanned images (volume) is 8837. The hours for that total is 06:57. When CR does 8837/6:57, it is reporting 21 mins. Its not right. When I do the formula below on a calculator I get a number that is right.
Here is the formula:
numberVar vol;
numberVar secs;
numberVar productivity;
vol := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Scan_Imgs}, {sp_get_Operator_Stats_ByDate_More_Than_One;1.operatorid});
secs := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Scan_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");
The number of scanned images (volume) is 8837. The hours for that total is 06:57. When CR does 8837/6:57, it is reporting 21 mins. Its not right. When I do the formula below on a calculator I get a number that is right.
Here is the formula:
numberVar vol;
numberVar secs;
numberVar productivity;
vol := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Scan_Imgs}, {sp_get_Operator_Stats_ByDate_More_Than_One;1.operatorid});
secs := Sum ({sp_get_Operator_Stats_ByDate_More_Than_One;1.Scan_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");