Error calculating the hours and minutes between 2 times

exflyer1996

Board Regular
Joined
May 25, 2009
Messages
123
The Start Time and End Time are exporting from our database in the following formats:

6:52:00 AM and 3:32:00 PM (although this displays in Military Time).

What I want to do is sum the time between the 2 in an hours and 10th of an hour format, so that a SUMIF formula will pull in the hours. Ideally, I like to be able to format the SQL file so that it calculates the time when I execute the query.

Many Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I don't know SQL, but if your earlier time is in cell A1 and your later time is in cell B1, the following formula will give you the hours rounded to the nearest tenth of an hour...

=ROUND(24*(B1-A1),1)
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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