[Solved] How to find all the timestamp values interval by each minute between the two timestamp records
Here is one option using an ad-hoc tally/numbers table and a Cross Apply Example Declare @YourTable Table ([Id] int,[Open Date] datetime,[Close Date] datetime) Insert Into @YourTable Values (1,’2019-07-03 16:28:39.497′,’2019-07-04 16:28:39.497′) ,(2,’2019-07-04 15:28:39.497′,’2019-07-05 19:28:39.497′) Select A.* ,TSRange = DateAdd(Minute,N,convert(varchar(16),[Open Date],20)) From @YourTable A Cross Apply ( Select Top (DateDiff(MINUTE,[Open Date],[Close Date])-1) N=Row_Number() Over (Order By (Select … Read more