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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL Date Format in Excel
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JAdauto
Posting Yak Master

USA
150 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?
Thx

robvolk
Most Valuable Yak

USA
15676 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  
 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.06 seconds. Powered By: Snitz Forums 2000