March 28, 2011 at 10:05 am
I have a Source column as DATE TIME datatype and I want to update the destination table column only with the DATE.
Source table : T1
Source Column (date time data type) : CallStart
Destination table: T2
Destination column: (DATE datatype) : Calldate
I am trying to use convert but i am facing an error.
Plz help me with this Query.
thanks
March 28, 2011 at 10:06 am
show us your query; what part is failing? what specific error are you getting?
are you using CONVERT(DATE,Yourdatetimefield)?
Lowell
March 28, 2011 at 10:10 am
Update T2
Set CallDate = ( select CallStart
from T1
where convert(Date, CallStart)
its an syntax error.
thanks.
March 28, 2011 at 10:41 am
to update from another table, you have to establish the relationship betweent he two tables...typically it's a column that has a common value betweent eh two tables:
Update T2
Set CallDate = convert(Date, CallStart)
from T1
--what relates the two tables together?
where T1.Id = T2.Id
Lowell
March 28, 2011 at 3:11 pm
BEGIN
Update TABLE1
Set Column1 = (Select convert(date,CallStart) as CallStart
From TABLE1
Inner join TABLE2 P ON A.ProcessID = P.ProcessID)
END
When I execute the above Query i am faing the following error.
Msg 512, Level 16, State 1, Line 2
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
any idea abt the error.?
thanks
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply