sql server - How to get Hours difference between login and logout -


how time in hours , hour difference between login , logout times?

i used below query:

select logindatetime,logoutdatetime fleet_driverqueuelist 

i have attached screenshot of data below.

enter image description here

try following:

select isnull(datediff(hour, logindatetime, logoutdatetime), 1) table 

Comments