SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

immad
Posting Yak Master

Pakistan
220 Posts

Posted - 06/08/2013 :  01:03:05  Show Profile  Reply with Quote

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

India
52325 Posts

Posted - 06/08/2013 :  03:17:45  Show Profile  Reply with Quote
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

Pakistan
220 Posts

Posted - 06/08/2013 :  07:18:26  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 06/08/2013 :  13:54:04  Show Profile  Reply with Quote
ok..good

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000