display hours over 24

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi,

I am currently adding up the overtime of employees in the report of my
database. However, I find that I can find that I can't go over 24hrs.
Everytime it reaches past 24 hrs, it starts counting at 0:00 again.

Is there anyway that I can change the format to be over 24hrs?

Thanks.

Peter
 
If you sum Date/Time fields, Access collects the result as a Date/Time since
day zero.

You can get the results in minutes like this:
=DateDiff("n", #0:00#, Sum([YourDateTimeField])

Use integer division to get the result in hours, and Mod to get the
remaining minutes:
=[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")
 
Thanks!

That worked.

By the way, can you recommend any good Access tutorial links or good Access
Books. A book that will talk about how to use VB and modules in Access
would be nice.

Also by the way, can I create my own custom formats using the "Format"
method you described below?

Thanks.

Peter

Allen Browne said:
If you sum Date/Time fields, Access collects the result as a Date/Time since
day zero.

You can get the results in minutes like this:
=DateDiff("n", #0:00#, Sum([YourDateTimeField])

Use integer division to get the result in hours, and Mod to get the
remaining minutes:
=[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Peter said:
I am currently adding up the overtime of employees in the report of my
database. However, I find that I can find that I can't go over 24hrs.
Everytime it reaches past 24 hrs, it starts counting at 0:00 again.

Is there anyway that I can change the format to be over 24hrs?
 
If you are ready for a serious developer's book the best is the MS Access
Developers Handbook by Ken Getz et al, published by Sybex, different years
(for the different versions of Access). It's now in 2 volumes: start with
volume 1.

For websites, see "Other sites of interest" at:
http://allenbrowne.com/tips.html

Yes, you can create custom formats. Help has the information for formats on
dates, numbers, and other types.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Peter said:
Thanks!

That worked.

By the way, can you recommend any good Access tutorial links or good Access
Books. A book that will talk about how to use VB and modules in Access
would be nice.

Also by the way, can I create my own custom formats using the "Format"
method you described below?

Thanks.

Peter

Allen Browne said:
If you sum Date/Time fields, Access collects the result as a Date/Time since
day zero.

You can get the results in minutes like this:
=DateDiff("n", #0:00#, Sum([YourDateTimeField])

Use integer division to get the result in hours, and Mod to get the
remaining minutes:
=[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Peter said:
I am currently adding up the overtime of employees in the report of my
database. However, I find that I can find that I can't go over 24hrs.
Everytime it reaches past 24 hrs, it starts counting at 0:00 again.

Is there anyway that I can change the format to be over 24hrs?
 
Back
Top