I am using SQL Server 2014. I am facing a problem when I want to compare previous row date time with current row in second. The error states:
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.
SQL Server 2016 solved this issue with DATEDIFF_BIG but that function is not supported in SQL Server 2014. And currently there are no plans to change database server with SQL Server 2016.
Any alternative solution would be appreciated.
SELECT ROW_NUMBER() OVER (Order by A.MDetailID) as Row
, DATEDIFF(SECOND, A.CreatedDate, LEAD(A.CreatedDate,1,0) OVER (ORDER BY A.CreatedDate)) FROM dbo.tbl_VehicleLiveMovementDetail A
- 1What is 'Legacy code' ?
- 1What are the main Advantages of Source Code Management?
- 0What is the difference between custom dimensions and metrics in Google Analytics
- 1How many lines of code are there in SCSS files in asset directory?
- 2Compile golang code to WebAssembly
- 2Is C# code is managed or unmanaged code?
- 1How can i write update query in SQL
- 1select statman sql server.
- 1how to write delete query in sql
- 1How to write insert query in SQL
- 1SQL Transaction