Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

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

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
tegronakron
Asked:
tegronakron
  • 2
1 Solution
 
frodomanCommented:
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
 
tegronakronAuthor Commented:
Wow that works great, saved me a ton of time!
Thanks
0
 
frodomanCommented:
Glad to help.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now