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 2005 Forums
 Transact-SQL (2005)
 Excel Date format in SQL..

Author  Topic 

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2010-05-20 : 07:13:35
Hi All!

I have taken over from somebody using a table in a database which contains date such as:

40523
40212

etc..

This is due to the data being imported from Excel and not converting correctly. Is there any sql script which I can use to convert the dates back?

i.e.
40338 09/06/2010
40365 06/07/2010
40362 03/07/2010
40269 01/04/2010
40523 11/12/2010

Many thanks!


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-05-20 : 07:28:02
[code]
dateadd(day, <excel date number>, '1989-12-30')
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -