I'm trying to calculate the working hours of employees while excluding the Break-in and Break-out base on their Time Reference. For now I'm using this function to accomplish my partial goal.
EDIT
Sample Problem:
Employee 1 has
Time Start: Dec 18 2017 8:00AM -
Time End: Dec 18 2017 17:00PM
Break-in: 12:00 PM - Break-out: 12:30 PM
Please take note that the Time Start and End is user input while the Break-in and out is from Database
SELECT DATEDIFF(HOUR, 'Dec 18 2017 8:00', 'Dec 18 2017 17:00')
Current Output: 9hrs
Expected Output: 8.5hrs because it is subtracted from the total break time