Let's assume Attendance Table has the following columns: Clocked In and Clocked Out, and Data Type for both the columns is DATETIME
For example, Clocked In column has the following Rows: 2016-01-01 09:30:00.000 and 2016-02-01 08:10:00.000.
For example, Clocked Out column has the following Rows: 2016-01-01 18:30:00.000 and 2016-02-01 18:20:00.000
Now I would like to calculate the time difference between Clocked In and Clocked Out which will display the output in the format of H:MM
To be more clear, Clocked Out(2016-01-01 18:30:00.000) - Clocked In (2016-01-01 09:30:00.000) should display the output as 9.00.
Clocked Out(2016-02-01 18:20:00.000) - Clocked In(2016-02-01 08:10:00.000) should display the output as 10:10
9:00 and 10:00 indicates number of hours an employee has worked or attended during that particular date.
I tried SELECT Clocked Out - SELECT Clocked FROM Attendance but it didn't work.
How can it be solved ?