As pointed out by a helpful member (and in my estimation date/time wizard) I was going about this all wrong. The easiest (and IMO best) way to do this is as follows:
create function SecTimeDay (@sec integer) returns varchar(19) as begin
declare @DayTime varchar(19)
/* Calculate # of days and display if necessary */ Select @DayTime = Case When @Sec >= 86400 Then Convert(VarChar(5), @Sec/86400) + ' days ' Else '' End /* Add HH:MM:SS to number of days (or ') for output */ + Convert(VarChar(8), DateAdd(Second, @Sec, 0), 108)
This function performs much better than the one I initially posted, and it also reports days.