Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This site is a great forum to exchange knowledge..."

Geography

Where in the world do Tek-Tips members come from?
ptrifile (TechnicalUser)
23 Apr 12 13:15
I have a report that shows the total time someone is logged into their phone.  The data is in seconds, so I take the sum of the seconds/86400 and format the text box as hh:nn:ss and i get the desired result if I am only looking at one days worth of data.  If it spans multiple days the data it shown incorrectly.  

If this was excel i would change the format from hh:mm:ss to [h]:mm:ss and it would rectify it.  Is there something similar in access?

Thanks for any suggestions!

Paul
Helpful Member!  SkipVought (Programmer)
23 Apr 12 13:28


hi,

Convert Seconds DURATION to DAYS and use the Format() function to return the text structure desired.

If you have multiple days worth, you must convert the seconds to days for each value and then subtract the Date/Time values to get DURATION (END - START)

BTW, if you had SECONDS in Excel, you would STILL need to convert Seconds to Days, in order to format as you suggested.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Helpful Member!  dhookom (Programmer)
23 Apr 12 13:41
I would create a small user-defined function that concatenates the number of hours and the formatted minutes and seconds:

CODE

Public Function HoursTime(datTime As Date) As String
    Dim intHrs As Integer
    intHrs = Int(datTime * 24)
    HoursTime = intHrs & ":" & Format(datTime, "nn:ss")
End Function
You will need to divide the seconds by 86400 to send to the function.

Duane
Hook'D on Access
MS Access MVP

ptrifile (TechnicalUser)
23 Apr 12 15:58
Dhookom, that worked perfectly, thank you so much!!!!!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close