Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Convert number to time Post Reply Post New Topic
Author Message
Lusco
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Online Status: Offline
Posts: 3
Quote Lusco Replybullet Topic: Convert number to time
     Posted: 17 Oct 2008 at 10:27am
Hi,

I need to convert a number to a time value.

Ex:

A database returns this value - 7,90
I need a formula to convert this to 7h54m

Thanks



Edited by Lusco - 17 Oct 2008 at 10:28am
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 17 Oct 2008 at 1:26pm
There are probably quite a few ways to do this.  I'm sure mine isn't the most elegant. 
 
I created 4 fields. 
 
comapos:
 
INSTR(1,{@dbfield},",")
 
hours:
 
 
minutes:
 
 
outputtime:
 
{@hours}& "h" & totext(int((tonumber({@minutes}) * 60) /100),0) & "m"

 
Hope this helps.  Good luck !
 
 


Edited by JohnT - 17 Oct 2008 at 2:13pm
IP IP Logged
Lusco
Newbie
Newbie
Avatar

Joined: 17 Oct 2008
Online Status: Offline
Posts: 3
Quote Lusco Replybullet Posted: 20 Oct 2008 at 2:02am
works fine Clap

thank you a lot

stay cool
regards

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