How to converting int datatype to time format in SSRS

How do we convert int datatype to "time format" like hh:mm:ss

ex:    123092   ( this 12  + 30 min + 92 sec)

       131137   ( 13 + 11 min + 37 sec)

       111747 ( 11 + 17 min + 47 sec)

 

thanks !

August 20th, 2015 12:50am

Hi Yori,

Try this

=Left(Fields!ColumnName.Value, 2) + "-" + Mid(Fields!ColumnName.Value, 3, 2) + "-" +  Mid(Fields!ColumnName.Value, 5, 2)

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 1:24am

ex:    123092   ( this 12  + 30 min + 92 sec)


92 Sekonds? So it is in real 12 h + 31 min + 32 sec instead?
August 20th, 2015 2:51am

Hi,

You can use example,  see this below expression.

declare @i int
--set @i = 3621
set @i = 363719 -- more than 100 hours
select replace(str(@i/3600,len(ltrim(@i/3600))+abs(sign(@i/359999)-1)) + ':' + str((@i/60)%60,2) + ':' + str(@i%60,2),' ','0')

Thanks.

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 7:31pm

Hi,

Please find the below query:

Thanks.

August 20th, 2015 7:46pm

Thank for answer Milan

its really helpful

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 11:37pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics