November 5, 2013 at 8:53 am
Hey guys. I tried to work out the solution myself before asking for help but couldn't get this to work. So here I am.
I have a old SQL 2005 or even 2000 table I'm pulling from and inserting into a table in a SQL 2012 DB. One field in particular is giving me a lot of grief. The data types are in fact both DateTime in the source table and the destination table. Yet, I still get the error:
Conversion failed when converting date and/or time from character string.
The source data is formatted like this:
2004-03-25 11:35:11.000
2004-05-18 15:06:29.000
...and I've tried:
CONVERT(DateTime2,[OldTable].[OldField], 121) As X
CONVERT(DateTime,[OldTable].[OldField], 121) As X
and have been referring to this page:
http://msdn.microsoft.com/en-us/library/ms187928.aspx
No luck.
Any thoughts?
November 5, 2013 at 9:32 am
Resolved. Thanks
November 5, 2013 at 2:05 pm
RedBirdOBX (11/5/2013)
Resolved. Thanks
Please post your resolution so that others might benefit. Thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply