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
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL Date Format in Excel
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

160 Posts

Posted - 03/27/2013 :  10:35:16  Show Profile  Reply with Quote
Im writing a SQL script that outputs DateTime data for a Date value, but when I output this to Excel, it will not "retain" the date format for the cell type. It just defaults to General cell type. The numerical data sets the cell type correctly. The string data sets the cell type correctly. But the Date for some reason will not retain Date format. Any ideas?

Most Valuable Yak

15732 Posts

Posted - 03/27/2013 :  10:49:57  Show Profile  Visit robvolk's Homepage  Reply with Quote
Excel is rather famous for mangling data formats. The only way to preserve it is to set the columns to Text before pasting data. If you're importing or using Text to Columns feature, you'd set the column type to Text on the last screen of the wizard.
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.03 seconds. Powered By: Snitz Forums 2000