Click here to Skip to main content
15,908,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
what will be output data type if i get
Error converting data type varchar to float.
exp.

i have CONVERSATION_TIME as float value .i.e. 1.24845245152. and i want value as 24:22:552141.

when i try below for the above result like
SQL
select lasnma ,
CONVERT(CHAR(5),CAST(SUM(Data.CONVERSATION_TIME) AS datetime), 8)
from namewcal


it gives error

Error converting data type varchar to float.
Posted
Updated 19-Mar-15 0:21am
v2
Comments
Saral S Stalin 19-Mar-15 6:12am    
The conversion time yields in days? In that case 1.24 * 24 it should be 29:55 hours right?
ZurdoDev 19-Mar-15 8:05am    
What exactly is your question?
maulikshah1990 19-Mar-15 8:08am    
I have float in sql which i want to convert to time (hh:mm:ss)..

for exp: i have .crd file in xml ,
<generatesqlstatement>
<sqlstatement>
<![CDATA[

select lname, (float value in time) , from tahblname

how to convert float to time..

1 solution

I found answer
ie.

CONVERT(TIME(0),CONVERT(datetime,1.09796836411745)),

this gives output as 02:21:04
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900