• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1595
  • Last Modified:

crystal reports Format sum of datediff to DD:HH:MM:SS

I need to output a formula field to the format DD:HH:MM:SS.  I am calculationg the datediff of a starttime and endtime and then summing the result.  I separated these out into NumDays, NumHours, NumMins, NumSeconds.  Now I want to string these together in this format DD:HH:MM:SS.   My problem is I keep getting 1 instead of 01 if the value is in single digits.  Example  1: 5: 2:56  for 1 day 5 hours, 2 minutes 56 seconds.
I tried the following but it isnt working
Totext({@NumDays},'##') & ":" &
Totext({@NumHours},'##') & ":" &
Totext({@NumMins},'##') & ":" &
Any ideas?
1 Solution
You are on the right track, except that you need to use '00' instead of '##':

Totext({@NumDays},'00') & ":" &
Totext({@NumHours},'00') & ":" &
Totext({@NumMins},'00') & ":" &
tegronakronAuthor Commented:
Thanks it worked!

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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