Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Compare date/time difference Post Reply Post New Topic
<< Prev Page  of 4 Next >>
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Sep 2012 at 11:12am
what is your datetimercvd formula?
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 27 Sep 2012 at 11:15am
date({tblService.DateReceived})+time({tblService.TimeReceived})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Sep 2012 at 11:30am
ahhh.
I assumed it was the total minutes formula uising the datediff.
what is that formula called?
 
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 27 Sep 2012 at 11:39am
DateDiff and its formula is:
 
DateDiff('n',{@DateTimeRecvd},{tvwr_TimeTransactions.StartDateTime})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Sep 2012 at 11:45am
totext(truncate((DateDiff('n',{@DateTimeRecvd},{tvwr_TimeTransactions.StartDateTime}))/1440),0,'') + ' days ' + totext((remainder((DateDiff('n',{@DateTimeRecvd},{tvwr_TimeTransactions.StartDateTime})),1440)/60),2,'') + ' hours'
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 27 Sep 2012 at 11:54am
It's working, awesome work DBlank!!!! What about getting an average of for all of the @DateDiff records?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Sep 2012 at 12:00pm
create your formula
DateDiff('n',{@DateTimeRecvd},{tvwr_TimeTransactions.StartDateTime})
 
then use the insert summary (Sigma button) and select average
place it in the group header or footer or report header or footer as desired
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 27 Sep 2012 at 12:14pm
I tried that and like fully expected it to work but I got back something like -1,544,159.80
 
I placed the summary in the Report Footer.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Sep 2012 at 1:24pm
I think you reversed your dates in your minutes formula so you are getting a negative value. Try and reverse the date order
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 27 Sep 2012 at 1:31pm
I appreciate you sticking with me on this...
 
I reversed them and am getting the same number without the minus. Here's the formula that I tried swapping the order:
 
DateDiff('n',{tvwr_TimeTransactions.StartDateTime},{@DateTimeRecvd})
IP IP Logged
<< Prev Page  of 4 Next >>
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.