Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Time counter Post Reply Post New Topic
Author Message
joep
Newbie
Newbie


Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 10
Quote joep Replybullet Topic: Time counter
     Posted: 26 May 2010 at 8:29am
Hi,
I trying to to calculate a time difference where there is a begin time and an end time in hours.
 
Any help would be greatly appreciated.
Joe
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 May 2010 at 8:55am
assuming it always on the same day  with no date values in your field (only times)...
 
datediff('h',currentdate+{table.starttime}),currentdate+{table.endtime2})
 
if it is using datetime fields then...
datediff('h',{table.starttime}),{table.endtime2})


Edited by DBlank - 26 May 2010 at 8:55am
IP IP Logged
joep
Newbie
Newbie


Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 10
Quote joep Replybullet Posted: 26 May 2010 at 9:41am

Does it matter that the begin and end times i'm trying to calculate is within the same field. The field is an insert date that tracks a task and once that tack is completed it tracks the next task and so on for that day. 

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 May 2010 at 10:54am
So you are comparing one row to the next row?
IP IP Logged
joep
Newbie
Newbie


Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 10
Quote joep Replybullet Posted: 27 May 2010 at 3:19am
no one row. I'm trying to calculate average tasks a user makes in a day, say 500 tasks / numbers of hours worked in the day(hours vary). I can calculate the number of tasks but its the hours that i'm struggling on.  Figured I use the insert date because that gives me the beginning and end time of each task. Thank you for your help inn this matter
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 May 2010 at 3:57am
Can you show me a couple of sample data rows (with column labels) and what you want it to do these samples?
IP IP Logged
joep
Newbie
Newbie


Joined: 14 Jan 2009
Location: United States
Online Status: Offline
Posts: 10
Quote joep Replybullet Posted: 27 May 2010 at 5:52am
Here is some sample data.  I'm looking for this end result. Here are 8 bills processed in 2.62 hours but if worked a full day that result should be (xx) bills processed in 8hrs. I hope this helps. Thank you.
Bill # Insert Date
00139431  5-26-2010  9:38 AM
00139440  5-26-2010  9:56 AM
00139442  5-26-2010  10:03 AM
00139447  5-26-2010  10:20 AM
00139454  5-26-2010  10:45 AM
00139465  5-26-2010  11:12 AM
00139470  5-26-2010  11:43 AM
00139473  5-26-2010  12:00 PM
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 May 2010 at 6:17am
Sorry but I am still a littel confused on what you are trying to do exactly.
here are some options that might spark an idea for you or help you to explain further...
If you create a group on the insert date field and set it to 'for each day'
you can do also do an insert summary as a DistinctCOunt of Bill# for each day
and/or
do a time differnece at the group level fromthe minimum date value to the maximum date value to see the time difference on that day
datediff('n',Minimum(insertdate,bill#),Maximum(insertdate,bill#))
 
Any of this helping?
IP IP Logged
trread
Newbie
Newbie
Avatar

Joined: 14 Jun 2010
Online Status: Offline
Posts: 1
Quote trread Replybullet Posted: 14 Jun 2010 at 4:25am
how do I sumarize maximum. I have to get the maximum of a group of numbers and then I have to summarize those at a higher group level
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