Предлагаемое решение ...
SET DATEFORMAT YMD
DECLARE @aux TABLE (TimeFrom datetime, TimeTo datetime, Status int)
DECLARE @res TABLE (YearMonth varchar(7), Status int, Sc int)
INSERT INTO @aux VALUES ('2018-04-01 09:03:27','2018-07-15 10:11:13',12)
DECLARE @secs int, @dt datetime, @fi datetime, @fo datetime,
@f1 datetime, @f2 datetime, @st int
SELECT TOP 1 @fi = TimeFrom, @fo = TimeTo, @st = status FROM @aux
SELECT @dt = DATEADD(mm, DATEDIFF(mm, 0, @fi), 0), @f1 = @fi
WHILE @dt < @fo
BEGIN
SELECT @f2 = CASE
WHEN DATEADD(mm, 1, @dt) < @fo
THEN DATEADD(mm, 1, @dt)
ELSE DATEADD(ss, 1, @fo)
END
SELECT @secs = DATEDIFF(ss, @f1, DATEADD(s, - 1, @f2))
INSERT INTO @res VALUES (CONVERT(varchar(7), @dt, 120), @st, @secs)
SELECT @f1 = @f2, @dt = DATEADD(mm, 1, @dt)
END
SELECT YearMonth,status
,CAST(Sc / 3600 AS varchar) + '.'
+RIGHT('0' + CAST((Sc - 3600 * (Sc / 3600)) / 60 AS varchar(2)), 2) + '.'
+RIGHT('0' + CAST(Sc % 60 AS varchar(2)), 2) AS [Duration (hhh.mm.ss)]
FROM @res