Wednesday, 21 August 2013

Char to DateTime Conversion

Char to DateTime Conversion

I have one column capturedatetime(Char(30)):
2006-04-25T15:50:59.997000 PM and 29-JAN-10 08.57.41.000000 PM
And I want to convert it and load it at other table column which have is
in DateTime. either by T-sql or SSIS which ever way.
I have tried with:
select CONVERT(datetime, '2006-04-25T15:50:59.997000 PM', 126)
But it creates an error:
Conversion failed when converting date and/or time from character string
Late update:
In this column I also have other data that is in a completely different
format:
29-JAN-10 08.57.41.000000 PM

No comments:

Post a Comment