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!

crystal reports shows 01:60 instead of 02:00 minutes

Status
Not open for further replies.

michelin

Technical User
Dec 18, 2011
38
US
my crystal report shows average time 01:60 minutes instead of 02:00 minutes. i never had a problem with this before.. my other average times are correct (02:03 or 03:45).. any ideas?
 
How did you create this average? Please show the contents of the formula (and of any nested formulas).

-LB
 
trhu formula:

NumberVar TotalSec := {#average call};
NumberVar Days := Truncate (TotalSec / 86400);
NumberVar Hours := Truncate (Remainder ( TotalSec , 86400) / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;


Totext ( Minutes , '00' ) + ':' +
Totext ( Seconds , '00' )

where {#average call} is from running total..

in my report i have one average time 02:00 for january but for february it is 01:60..
 


I'd convert seconds to days and use ToText(days,'mm:ss')

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


ToText(TotalSec / 86400), 'mm:ss')

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Try this (adapted from the SynapseVampire FAQ):

whileprintingrecords;
numberVar dur := {#average call};
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;
hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);
mmss := totext(min,"00") + ":" + totext(sec,"00");
mmss

Note that the average will likely only be correct in a footer section, and so this formula should be there also.

-LB
 
I tried that but it didn't work :(((.. there is still time 01:60..

my report looks like:

month average time number of calls
january 2011 01:60 5369
february 2011 02:00 5287

it's just weird.. i never had a problem with this formula before..

thank you for your help anyway!!
 


did you try my suggestion?

ToText(TotalSec / 86400), 'mm:ss')

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
yeah, but it didn't work ://

but i made formula
if ({@average_call}) like '*01:60*' then '02:00'
else {@average_call}

and it works.... it's just weird...
 


How could that work, since {@average_call} UNITS is SECONDS???

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
it's not.. i had it in formate mm:ss.. i think :~
 


???

Please do not make allegations that are misleading, ambiguous or inconsistent.

Please be clear, concise and complete for everyone's benefit, including yourself.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Does the field you are summarizing contain any milleseconds?

-LB
 


This is not a matter of being simply pedantic.

Other members who read this thread, will want to see a cogent conclusion and be rightly informed thereby.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
What happens if you try:

whileprintingrecords;
numberVar dur := round({#average call},0);
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;
hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);
mmss := totext(min,"00") + ":" + totext(sec,"00");
mmss

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top