Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How to convert datediff from minutes to hh:mm Post Reply Post New Topic
Author Message
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Topic: How to convert datediff from minutes to hh:mm
    Posted: 16 Jun 2010 at 11:03am
I have are report with shift start and end times. I have a formula giving me the difference in minutes like this.

Datediff("n",StartTime,EndTime)

Which gives me the minutes.

But if I try to /60 I am getting rounded numbers
I also tried using "h" in the datediff and got the same results

Example
1:30 pm       4:00 pm     I am getting 3.0 for the hours difference.

What I am trying to get as the result is 2:30 for the time difference.

Any help is always appeciated.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jun 2010 at 11:36am
try
time({table.starttime} - {table.endtime})
then format the resulting formula field to use the "13:23" format option
 
 
...As long as you do not have any result minutes > 24 hours


Edited by DBlank - 16 Jun 2010 at 11:37am
IP IP Logged
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Posted: 16 Jun 2010 at 4:26pm
Once again thank you for a simple solution.
IP IP Logged
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.031 seconds.