Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Error

Author  Topic 

immad
Posting Yak Master

230 Posts

Posted - 2013-06-08 : 01:03:05

i am having this error

Msg 257, Level 16, State 3, Procedure query, Line 21
Implicit conversion from data type datetime to float is not allowed. Use the CONVERT function to run this query.



this is the line and red one is the column that i replace from 540


CAST (ABS( t4.LTime - DATEDIFF (MINUTE, t.[Timein], t.[Timeout] ) ) % 60 as varchar ) + ' min' as excesshort, -- Minutes


this column t4.LTime datatype is datetime


immad uddin ahmed

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-08 : 03:17:45
you cant apply ABS over datetime field

the result of t4.LTime - DATEDIFF (MINUTE, t.[Timein], t.[Timeout] ) would be a datevalue not a numeric one

Please elaborate on what you're trying to get and we may suggest an alternative

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-06-08 : 07:18:26
i got it i change l4.ltime hours into minute then i replace t4.ltime to minute field

immad uddin ahmed
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-08 : 13:54:04
ok..good

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -