Question : importing a date field from oracle into MSSQL

the date field in oracle is just a text field. Here is the format in oracle
01OCT2007:00:00:00
15OCT2007:20:55:53


Wehn I try to convert or cast this in anyway (that I know of), I get the following error.

Conversion failed when converting date and/or time from character string.

Thanks for any help

Answer : importing a date field from oracle into MSSQL

i think it's more than just the first colon the problem, I think you need to convert to format 113 - Europe default + milliseconds,
dd mon yyyy hh:mi:ss:mmm(24h)

So I would do it like this:

 

select convert(datetime, stuff(stuff(stuff(yourcolumn, 3, 0, ' '), 7, 0, ' '), 12, 1, ' '), 113)  from yourtable

Random Solutions  
 
programming4us programming4us