Difference of two date time in sql server

后端 未结 20 2091
心在旅途
心在旅途 2020-12-01 03:53

Is there any way to take the difference between two datetime in sql server?

For example, my dates are

  1. 2010-01-22 15:29:55.090
20条回答
  •  日久生厌
    2020-12-01 04:29

    The following query should give the exact stuff you are looking out for.

    select datediff(second, '2010-01-22 15:29:55.090' , '2010-01-22 15:30:09.153')
    

    Here is the link from MSDN for what all you can do with datediff function . https://msdn.microsoft.com/en-us/library/ms189794.aspx

提交回复
热议问题