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

Posted on 2006-04-12
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(Remainder({#SecondsTotal},86400) ,'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.
Question by:tegronakron
    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');

    Author Comment

    Wow that works great, saved me a ton of time!
    LVL 42

    Expert Comment

    Glad to help.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    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.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now