Solved

crystal reports sum up date fields in format DD:HH:MM:SS

Posted on 2006-04-12
398 Views
Last Modified: 2010-05-18
I am trying to find the sum of the downtime in format DD:HH:MM:SS
Here is what i currently have:
Totext({#SecondsTotal}/86400,'00')
& ":" &
Totext(Remainder({#SecondsTotal},86400) ,'00')
& ":" &
Totext(Remainder({#SecondsTotal},3600),'00')
& ":" &
Totext(Remainder({#SecondsTotal},60),'00')

The problem is that it is not rolling up the leftover seconds to the minutes column, hours, and days.
I read somewhere about adding these in but I dont know how to do it.
0
Question by:tegronakron
3 Comments

LVL 42

Accepted Solution

Here's one way:

numberVar numberSeconds := {#SecondsTotal};
numberVar days := int(numberSeconds/86400);
numberSeconds := numberSeconds - (days * 86400);
numberVar hours := int(numberSeconds/3600);
numberSeconds := numberSeconds - (hours * 3600);
numberVar minutes := int(numberSeconds/60);
numberSeconds := numberSeconds - (minutes * 60);
ToText(days,'00') + ":" + ToText(hours,'00') + ":" + ToText(minutes,'00') + ":" + ToText(numberseconds,'00');
0

Author Comment

Wow that works great, saved me a ton of time!
Thanks
0

LVL 42

Expert Comment

Glad to help.
0

Join & Write a Comment Already a member? Login.

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

754 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!