declare @input int = 113804
-- these are the different parts that will be used
select @input / 10000
select (@input / 100) % 100
select @input % 100
-- SQL Server 2008 Query
select convert(time, dateadd(ss, @input % 100, dateadd(mi, (@input / 100) % 100, dateadd(hh, @input / 10000, '19000101'))))
-- SQL Server 2012 Query
select timefromparts(@input / 10000, (@input / 100) % 100, @input % 100, 0, 0)
└> bt
Forum Etiquette: How to post data/code on a forum to get the best help[/url]