The old 24 hour clock problem

Wes

Board Regular
Joined
Jan 30, 2004
Messages
195
Hi all,

I'm a frequent excell user but Ive come to a point that I need to use access for some of my tasks ...

What I have is three text boxes. text box 1 = StartTime, text box 2 = EndTime and text box 3 = interval.

text box 1 and 2 contain as you can probably tell start and end times in a 24 hour format. What I need to do is have the interval text box calculate a value of time in hours and minutes should the ne time go into the next day. So if the start time was 23:50 and the end time was 00:15 then the time interval would be 00:25 not the negative number that is given.

Any help would really be appreciated.

Thanks

Wes
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Wes

How are you currently calculating the difference?

Try this expression to return the minutes

IIf([StartTime]>[EndTime],(24*60)-DateDiff("n",[EndTime],[StartTime]),DateDiff("n",[StartTime],[EndTime]))
 
Upvote 0

Forum statistics

Threads
1,221,899
Messages
6,162,686
Members
451,782
Latest member
LizN

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