c# - Sql Query to show minutes as HH:MM but with time datatype -


i have sql query converting minutes hh:mm format using query

declare @tempt table(col1 int) insert @tempt   select 140 union select 35 select cast (cast((col1)/60 varchar)     + ':' + right('0' + cast((col1)%60 varchar),2) time) running   @tempt 

and output

running 02:20:00.0000000 00:35:00.0000000 

but want show 02:20 , 00:35 .

how eliminate these rest of zero's ?

we can cast this,

select convert(varchar(5),getdate(),108)  

replace getdate() datetime object


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -