Saturday, February 25, 2012

Changing number to date

I have a table in SQL Server that has a date field whose properties are 'number'. I want to export this data to a table in Oracle. I can't touch the Server table to alter it to be a date. Is there some way I can do this in the Oracle table? Example- SQL Server= 20030324 (March 24,2003). In Oracle I want it to read '24/03/2003', or some other date format.declare @.d as int
set @.d = 20031105
select cast(substring(cast(@.d as varchar(8)),5,2)+ '/' +
substring(cast(@.d as varchar(8)),7,2)+ '/' +
left(cast(@.d as varchar(8)),4)as smalldatetime)|||I need to update a whole column in an Oracle table. Thanks.

No comments:

Post a Comment