SQL Server: datediff function resulted in an overflow when using MILLISECOND
问题 I have the following query : select CONVERT(varchar(12), DATEADD(MILLISECOND, DateDiff(MILLISECOND, '2014-08-04 10:37:28.713','2014-11-04 08:21:17.723'), 0), 114) When I execute this, I get the error : "The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart." When I change the query to the following it works fine : select CONVERT(varchar(12), DATEADD(SECOND, DateDiff(SECOND, '2014