Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Formula for converting to Hours,Mins and Secs Post Reply Post New Topic
Author Message
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Topic: Formula for converting to Hours,Mins and Secs
    Posted: 02 Jun 2011 at 12:44am
I have a field that is formatted as a time field which gives me the time in seconds only. I just need to know how to convert the seconds into hh:mm:ss format,how do I write a formula for converting the time kindly help me.

Thanks in advance
Ramakrishna Reddy
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Jun 2011 at 4:25am
local numbervar tme := {table.field};
local numbervar hr := 0;
local numbervar mn:=0;
local stringvar s;
local stringvar m;
 
hr := cint(tme/3600);
tme := tme - hr*3600;
mn := cint(tme/60);
tme:=tme - mn*60;
s:=totext(tme,0,"");
m:=totext(mn,0,"");
if tme<10 then s:="0"+s;
if mn<10 then m:="0" +m;
totext(hr,0,"")+":"+m+":"+s
 
 
HTH
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.