SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

aakcse
Aged Yak Warrior

India
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.

Regards,
aak

Lumbago
Norsk Yak Master

Norway
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
http://xkcd.com/327/
Go to Top of Page

aakcse
Aged Yak Warrior

India
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  
 New 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.03 seconds. Powered By: Snitz Forums 2000