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
Post a Comment