469,270 Members | 1,146 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

How to convert seconds to hh:mm?

ddtpmyra
333 100+
Help! I have value of a field in seconds. I know is how to get the minutes by dividing it to 3600. But I wanted to display it in HH:mm.

given number for seconds is 8111
Feb 15 '11 #1
9 10195
ddtpmyra
333 100+
what's wrong with this?
Expand|Select|Wrap|Line Numbers
  1. AcdCallsDuration: Format(([DAgent]![AcdCallsDuration]\60) Mod 60,":00") & Format([Dagent]![AcdCallsDuration]>"Mod 60",":00")
Feb 15 '11 #2
beacon
579 512MB
Try this out:

Expand|Select|Wrap|Line Numbers
  1. Format([YourFieldHere]/3600, "hh:nn")
  2.  
Feb 15 '11 #3
ddtpmyra
333 100+
I think this will simplify my code. However how can I sum the final result?

Expand|Select|Wrap|Line Numbers
  1. Format(([YourField]/3600),"hh:nn:ss") 
Feb 15 '11 #4
ddtpmyra
333 100+
Im having data type mismatch error if I sum the time HH:NN.
Feb 15 '11 #5
yarbrough40
320 100+
looks as though you are looking at call center data (acd). I had a similar problem displaying call duration for a call center with a .net app. Tryed to replicate the excel function [h]:mm:ss.
here was my solution - not sure if it helps you or not.
http://bytes.com/topic/visual-basic-...-ss-like-excel
Feb 16 '11 #6
beacon
579 512MB
Have you tried to sum the time(s) while still in seconds, then format it to hh:mm afterwards?
Feb 16 '11 #7
ddtpmyra
333 100+
@Beacon

I tried it but after I got 00:00:00 result value.
Feb 24 '11 #8
beacon
579 512MB
Ok...how did you try it? Can you give an example of the data you're using, the function/expression you used to add the items together, and describe how you tried to convert it?
Feb 24 '11 #9
whodgson
542 512MB
To get minutes divide seconds by 60
To get hours divide seconds by 3600
8111 /3600 = 2.253055556 ....2HH
.253055556*60=15.18mm
Feb 25 '11 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Rudi Groenewald | last post: by
4 posts views Thread by hikums | last post: by
3 posts views Thread by Barney | last post: by
6 posts views Thread by Able | last post: by
2 posts views Thread by Robert Brown | last post: by
5 posts views Thread by kpp9c | last post: by
15 posts views Thread by Jay Tee | last post: by
1 post views Thread by Vishal Bhargava | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.