Store procedure busca
tema enviado por macdroopy en SQL
tema iniciado el 23/06/2011
tengo el siguiente query
Select Row_Number() OVER (ORDER BY cch.CallStart),cus.Code As Codigo,cus.Name As Nombre,cch.CallStart,Convert(Char(5),cch.CallStart,108) As HoraInicio,cch.CallEnd,Convert(Char(5),cch.CallEnd,108) As HoraFin,
DATEDIFF(MINUTE,cch.CallStart,cch.CallEnd) As TiempoServicio
From dbo.CustomerCallHeader cch Inner Join dbo.Customer cus On cch.CustomerID = cus.CustomerID
Where cch.CallStart >= @FehaInicio And cch.CallStart <= @FechaFin
And cch.EmployeeID = @NumEmpleado
And cch.CallEnd Is Not Null
Group by cus.Code,cus.Name,cch.CallStart,cch.CallEnd
Order by cch.CallStart
necesito obtener el tiempo que hubo entre CallEnd a la siguiente CallStart
gracias