Display Total Minutes in Days:Hours:Minutes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am totaling a column of multipe elapse times. I want to then display the
resulting total minutes in Days:Hours:Minutes.

i.e. 2,456 minutes would display 1:16:56
 
An example in the Immediate window ...

? 2456\1440 & ":" & (2456 mod 1440) \ 60 & ":" & (2456 mod 1440) mod 60
1:16:56

Replace the hard-coded "2456" in the above expression with a reference to
your field, variable or whatever.
 
Try this

int([FieldName]/1440) & ":" & int(([FieldName] mod 1440)/60) & ":" &
[FieldName] mod 1440 mod 60
 
Access doesn't really support this very well: the only Date/Time data type
is intended for timestamps (i.e.: specific points in time), not durations.

The usual advice is to store durations as long integers in the smallest
granularity. In your case, since you're only interested in days, hours,
minutes, you'd store the durations as minutes. You'd then need to write a
couple of functions to convert from TotalMinutes to d:hh:nn.

Alternatively, take a look at my October, 2003 "Access Answers" column in
Pinnacle Publication's "Smart Access". You can download the column (and
sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html
 
This worked perfect! Thanks a bunch you're a life saver. -Charles

Ofer said:
Try this

int([FieldName]/1440) & ":" & int(([FieldName] mod 1440)/60) & ":" &
[FieldName] mod 1440 mod 60

--
\\// Live Long and Prosper \\//
BS"D


cbjames said:
I am totaling a column of multipe elapse times. I want to then display the
resulting total minutes in Days:Hours:Minutes.

i.e. 2,456 minutes would display 1:16:56
 
I downloaded the article and database. There is much information there,
Thanks! -Charles
 

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

Back
Top