Converting seconds into Days, Hours, Minuites

G

Guest

I have performed a datediff on two dates / time values giving a result into
seconds and I wish to extract the day, hour and minuite portions in three
variables.

For example

if seconds = 86400 then days = 1, hours = 0, min = 0
if seconds = 86460 then days = 0 , hours = 0 min = 1
etc...
 
J

John Spencer

Seconds\86400 will return integer days

(Seconds Mod 86400) \ 3600 will return integer hours

(Seconds Mod 3600)\ 60 will return integer minutes

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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