Convert a second value into hours mintues and seconds

What i need to achive :

There is a value that is stored in the database ( call_req.time_spent_sum) this has a value in seconds


I need this value to be given as hours:mintues:seconds
so if call_req.time_spent_sum = 4830
i need to get 1:20:30
this is got by
3600 + 1200 +30

now after getting this value

i also have to get the sum of the amount of hr:min:sec spent on solving a particular problem in that day .

there are a few functions i have come across

such as
hour
minutes
second
CTime
Time

Ive tried these but I am unsuccessful in getting the solution.

Please advice
ASAP .
picasothakkarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bdreed35Commented:
Try this formula:

local numbervar total_secs := {call_req.time_spent_sum};
local numbervar hrs := int(total_secs / 3600);
local numbervar mins := int(remainder(total_secs,3600)/60);
local numbervar secs := remainder(remainder(total_secs,3600),60);

totext(hrs,0,"") & ":" & totext(mins,0,"") & ":" & totext(secs,0,"")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wykabryanCommented:
I would suggest that in the CR you summarize your seconds before you display them with the above formula.  This way you are able to acheive both results in multiple areas.  
0
Ken TurnerCommented:
If you need to convert seconds to a proper time field (as opposed to a string field as described above), all you need is:

time({YourSeconds}/24/60/60)
0
bdreed35Commented:
Ken:

I agree that will work, just with the caveat that when the number of seconds are >= 86400, then you will not see the elapsed correct time.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.