Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Minute conversion to hours:minutes Post Reply Post New Topic
Author Message
KSAnalyst
Newbie
Newbie
Avatar

Joined: 04 Mar 2008
Location: United States
Online Status: Offline
Posts: 29
Quote KSAnalyst Replybullet Topic: Minute conversion to hours:minutes
     Posted: 10 Mar 2008 at 8:11am

I am trying to convert minutes into an hour: minute format.  In MS Access I have used a Mod function that looked like this:

in a calculation field I placed the following formula:
 
=([My.Field]\60 & Format([My.Field] Mod 60,"\:00"))
 
Where My.Field would look like 1440 (minutes) and it would convert it to 24:00 (hours:minutes)
 
Is there a similar formula for Crystal XI?
 
Thanks,
 
Kevin
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Mar 2008 at 4:11pm
In Crystal, you can also use Mod.  Try something like this (in Crystal syntax).
 
ToText({My.Field}\60, 0) + ':' + right('0' + ToText({My.Field} mod 60, 0), 2)
 
This is off the top of my head and I haven't tested it, so you may have to tweak it.
 
Or, this might be easier:
 
Time({My.Field}\60, {My.Field} mod 60, 0)
 
(assuming there are never any seconds in {My.Field})
 
-Dell


Edited by hilfy - 10 Mar 2008 at 4:13pm
IP IP Logged
KSAnalyst
Newbie
Newbie
Avatar

Joined: 04 Mar 2008
Location: United States
Online Status: Offline
Posts: 29
Quote KSAnalyst Replybullet Posted: 10 Mar 2008 at 4:12pm
Thank you,

I will give it a try.

Kevin
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