We can be use CONVERT () function to calculate the time difference between two timestamps in hours and minutes.
Here is the example
Declare @Date_2 DATETIME = '2020-04-30 10:01:10.022'
Declare @Date_1 DATETIME = '2020-04-30 10:00:00.000'
Select CONVERT (TIME, @Date_2 - @Date_1) as Elapsed_Time
The output for the above query would be:
To become an SQL expert, you can register for for the best SQL courses by Intellipaat that offers instructor-led training, certification, and job assistance