Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Time Calculations Post Reply Post New Topic
Author Message
sbumbaugh
Newbie
Newbie


Joined: 12 May 2011
Location: United States
Online Status: Offline
Posts: 3
Quote sbumbaugh Replybullet Topic: Time Calculations
     Posted: 12 Jan 2012 at 8:01am
It's a very simple formula, Time Completed (07:07:18am) minus Time Allocated (07:05:53am).  Right? 

I can't get the result to display in the same format.  I'm returning a simple 85.

This is probably such an easy fix, but it's eluding me. 


Edited by sbumbaugh - 12 Jan 2012 at 8:03am
sbumbaugh
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jan 2012 at 9:34am
I assume you just want to display it in HH:MM:SS.
You can either write a formula to divide the seconds into hours minutes and seconds
or you could change the result back to a time value
something like
time(dateadd('s',(timecompleted - timeallocated),datetime(1900,1,1,0,0,0)))
and set the result to display as military time
IP IP Logged
sbumbaugh
Newbie
Newbie


Joined: 12 May 2011
Location: United States
Online Status: Offline
Posts: 3
Quote sbumbaugh Replybullet Posted: 13 Jan 2012 at 5:24am
Thank you.  That worked.  I struggle with the formulas.  The report is grouped by each work unit, showing the start (allocated time) and end (completed time).  this formula allows me to view the result amount of time spent working on that one particular container.

Now I need to figure out how to sum up all the results as a grand total on the report.

I am not giving up!
sbumbaugh
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2012 at 9:59am
To get a group total use your original formula to get total second per row then sum that for the group.
Use that sum to display by using it in the same type of date add formula like above or a formula to convert into text.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum