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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Importing issue
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

570 Posts

Posted - 01/22/2010 :  02:46:41  Show Profile  Reply with Quote
Hi all,

I have imported a tabel from sql 2005 to excel 2007, I am getting dates for some columns as '1/2/1900 12:00:00 AM'

However when I do a select in sql it gives me
'1900-01-01 00:00:00.000' which is right,

why the date is getting changed in excel for only some columns, and the datatype for those columns is date only.


Norsk Yak Master

3271 Posts

Posted - 01/22/2010 :  02:57:31  Show Profile  Reply with Quote
Madhi is probably able to give you a better advice on this one (he's the excel whiz among us) but what I do is to convert the datetime columns to varchar in the correct format first sort of like this:

SELECT Something, MyDateColumn AS CONVERT(varchar(25), MyDateColumn, 120)

- Lumbago
Go to Top of Page

Aged Yak Warrior

570 Posts

Posted - 01/22/2010 :  04:18:50  Show Profile  Reply with Quote
Thanks Lumbago,

I'll put this question in excel forum.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000