SQL Convert Nvarchar(255) to DateTime problem
Posted
by steven
on Stack Overflow
See other posts from Stack Overflow
or by steven
Published on 2010-05-06T18:35:45Z
Indexed on
2010/05/06
18:48 UTC
Read the original article
Hit count: 155
Hi,
I'm using SQL server 2008.
I have 2 Tables: Table 1 and Table 2.
Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null
Example data in Table 1:
26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03
When i try CAST(OldDate as datetime)
I get this error: Arithmetic overflow error converting expression to data type datetime.
I need to insert OldDate into NewDate with no errors. I can't skip some rows.
Anyhelp would be appreciated.
© Stack Overflow or respective owner