Technical Article

Difference between dates: Time Format

,

This function returns the difference between dates in the HH:MM:SS format.

create  function timeDiff(@StartDate datetime, @EndDate datetime)
returns varchar(25)
as
begin
return convert(varchar(25),dateadd(ss,datediff(ss, @StartDate,@EndDate),'1 jan 2004'),8)
end

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating