You can also subtract the earlier time from the later time and get a result that represents the difference as an elapsed time since the SQL Server "zero" time point, 1900-01-01 00:00:00.000With the elapsed time, you can extract days, hours, minutes, seconds, and milliseconds.select Days = datediff(day,0,ET), Hours = datepart(hour,ET), Minutes = datepart(minute,ET), Seconds = datepart(second,ET), Milliseconds= datepart(millisecond,ET), [Elapsed Time] = ETfrom -- Get time difference (select ET = convert(datetime,'4:30 PM')-convert(datetime,'8:30 AM')) aResults:Days Hours Minutes Seconds Milliseconds Elapsed Time---- ----- ------- ----------- ------------ -----------------------0 8 0 0 0 1900-01-01 08:00:00.000(1 row(s) affected)
CODO ERGO SUM