Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Convert nvarchar to datetime and format

Author  Topic 

poser
Posting Yak Master

124 Posts

Posted - 2008-11-19 : 16:36:35
Good afternoon all;

I have two tables
tbl1 has two columns:

LastName and CDate(nvarchar,255)

and the date in table one is displayed as: Thu Apr 16 23:59:59 2009


tbl2 has two columns:

LastName and RDate(Datetime,8)
and the date in table one is displayed as: 2009-06-27 00:00:00.000


I want to import the tbl1.cDate into tbl2.RDate and in the process convert it from nvarchar,255 to datetime,8 and formatted to match the other dates in tbl2.RDate


I have over 200 dates to import....

Please, any help is much appreciated!
R/P

SimpleSQL
Yak Posting Veteran

85 Posts

Posted - 2008-11-19 : 21:48:36
Check out books online for CAST and CONVERT functions. This would allow you to convert data type, including character to date.
Go to Top of Page
   

- Advertisement -