Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oracle date to sql server format

Status
Not open for further replies.

eja2000

Programmer
Nov 30, 2003
209
NG
i have 26022005 09:34:18 in avarchar field.
how can i format this to a date?
thanks..
it came from an oracle database.
 
Use this script to add in some slashes:

Code:
update tbl
set col = stuff(col, 3, 0, '/')

update tbl
set col = stuff(col, 6, 0, '/')

Then use this to change the column to datetime:

Code:
SET DATEFORMAT dmy

ALTER TABLE tbl
ALTER COLUMN col datetime

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top