Problem adding times together

J Carvell

Board Regular
Joined
Sep 20, 2005
Messages
55
I have written a query that adds a group of times together. Unfortunately when the result should be 25 hours for example the database shows 1 hour. I assume every 24 hours the system reverts back to zero.

In excel to prevent this formatting cells to "[hh]:mm" solves the problem but this doesn't appear to work in access. Is there some other way?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi
In your query you could try using something like this :

Code:
TotHours :  Hour([time1]) + Hour([time2]) + ((Minute([time1]) + Minute([time3]))/60)

Make sure you use your actual field names.

HTH, Andrew :)
 
Upvote 0
Each record has a field of [time] formatted to short time. In my query I use Sum of [time] again formatted to short time.

Is there any code anyone can suggest to prevent the system from going back to zero after 23:59?
 
Upvote 0
Have you tried a format other than short time? AFAIK time formats don't go beyond 24 hours.

Andrew
 
Upvote 0

Forum statistics

Threads
1,223,521
Messages
6,172,815
Members
452,481
Latest member
Najwan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top