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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Correct Syntax Required Please

Author  Topic 

Jonny1409
Posting Yak Master

133 Posts

Posted - 2007-10-01 : 04:00:13
Hello,

I have one final problem with one of my fields in my update statement, and would appreciate if anyone can help.

My code is :


update dbo.tbl_EmployeeDetails
set ContractedHoursPerWeek =
( select
PartTimeHours
from
dbo.Staging_EmployeeDetails
where AutoRef = dbo.tbl_EmployeeDetails.TechnicianID)


but it gives the following error message :

Syntax error converting the nvarchar value '28:00' to a column of data type int.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-01 : 04:16:25
How you want to represent part time hours in terms of Integer?
Let's say if time is "1:28", how would you represent as integer value?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Jonny1409
Posting Yak Master

133 Posts

Posted - 2007-10-01 : 04:26:09
The number will only ever be a number between 1.00 and 35.00 so the int value would be 1 through 35
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-01 : 05:16:57
"The number will only ever be a number between 1.00 and 35.00"

Do you mean
1) an integer number between 1 and 35
2) A decimal number between 1 and 35, but you only want the integer part
3) A decimal number, in which case what do you want to do with the decimal part?

Sorry if I'm being thick!

Kristen
Go to Top of Page
   

- Advertisement -