Convert Decimal values(hours) to Appropriate Hours in sql server 2008 -


i have column called timespent of type float.

it contains values (i.e. 2.50, 1.25, 3.75, 5.60 )

i need convert these hour values appropriate hour values (2:30, 1:15, 3:45 ,5:36) etc)

how can done?

try query

select  time_decimal ,cast(cast(cast(time_decimal int) varchar)+ ':'+cast(cast((time_decimal - cast(time_decimal int)) * 60 int) varchar)+ ':'+cast(cast(((time_decimal - cast(time_decimal int)) * 60-     cast((time_decimal - cast(time_decimal int)) * 60 int)) * 60 int) varchar) time) real_time time1 

sql fiddle


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -