Thanks Uri.
Below is the actual statement:
UPDATE Reprinting
SET EvaluatedDate = [Evaluation Date]
FROM Evaluated
JOIN Reprinting ON
(Reprinting.p1 + '/' +
Reprinting.p2 + '/' +
Reprinting.p3 + '/' +
Reprinting.ppp + '/' +
Reprinting.bbb + '/' +
CAST(Reprinting.RefNo_Print AS VARCHAR(5)) + '/' +
Reprinting.reprintno)
= Evaluated.[pan number]
AND Evaluated.[Evaluation Date] IS NOT NULL
I have ran the update statement above but i get this error:
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.
I think i need to convert the Evaluated.[Evaluation Date] (Table2.column2)
from NVARCHAR(50) to DATETIME first. But I am not sure how to write this
query. Can you please help?
Thanks again.
[quoted text, click to view] "Uri Dimant" wrote:
> Christine
>
> UPDATE Table1 SET Column1 =Column2 FROM Table2 JOIN
> Table1 ON Table1.Column3= Table1.Column4 AND Table2.Column2 IS NOT NULL
>
>
>
>
>
>
>
> "Christine C" <Christine C@discussions.microsoft.com> wrote in message
> news:732F54AC-FA70-46FF-B407-E0528E283FEA@microsoft.com...
> >I have a database with 2 tables (Table1 & Table2).
> >
> > I want to update Column1.Table1 using the value from Column2.Table2 where
> > Column3.Table1 = Column4.Table2 AND Column2.Table2 IS NOT NULL.
> >
> > The datatype for Column1.Table1 is in DATETIME. The datatype for
> > Column2.Table2 is in NVARCHAR(50). An example of the value in
> > Column2.Table2
> > is: 01/01/2006, assuming all values in Column2.Table2 is in format
> > dd/mm/yyyy.
> >
> > What is the best way to tackle this in SQL Server 2000 and how?
> >
> > Many thanks.
>
>