length minutes and seconds

B

BBran

How does one get a numeric field representing length of time in seconds, to display as length of time in minutes and seconds? In other words 244 seconds equals 4 minutes and 4 seconds (4:04).
 
P

PC D

244\60 = 4 'backslash is integer division
244 Mod 60 = 4 'Mod returns the remainder from a division

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1175 users have come to me from the newsgroups requesting help
(e-mail address removed)


How does one get a numeric field representing length of time in seconds, to
display as length of time in minutes and seconds? In other words 244
seconds equals 4 minutes and 4 seconds (4:04).
 
D

Douglas J. Steele

So, to give a complete answer, you can write a function like:

Function ConvertToMinutesAndSeconds(TotalSeconds As Long) As String

ConvertToMinutesAndSecond = TotalSeconds \ 60 & _
":" & Format(TotalSeconds Mod 60, "00")

End Function
 
B

BBran

Thank you both very much!

So, to give a complete answer, you can write a function like:

Function ConvertToMinutesAndSeconds(TotalSeconds As Long) As String

ConvertToMinutesAndSecond = TotalSeconds \ 60 & _
":" & Format(TotalSeconds Mod 60, "00")

End Function
 
S

StopThisAdvertising

PC D said:
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications 'Resource ????
Over 1175 users have come to me from the newsgroups requesting help '1175 users ????
(e-mail address removed)

--
To Steve:
Why don't you just get lost? No-one wants your advertising/job hunting here!
Over 625!! users from the newsgroups have visited the website to read what kind of a 'resource' you are... (rapidly increasing..)

To the original poster:
Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top