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.
Author |
Topic |
tjonas
Starting Member
17 Posts |
Posted - 2014-08-14 : 14:32:57
|
The date in sql appears like this '07/25/2013 00:00:00' but when I export to excel the date shows like this '22-JUL-81 12.00.00.000000000 AM'. When I change format in excel nothing happens. |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-14 : 14:44:17
|
How are you exporting to Excel? |
 |
|
tjonas
Starting Member
17 Posts |
Posted - 2014-08-14 : 14:52:54
|
quote: Originally posted by gbritton How are you exporting to Excel?
Right clicking on the query results --> export date --> xls |
 |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-14 : 15:03:40
|
I don't think that's in standard SSMS. I Only see:CopyCopy with HeadersSelect AllSave Results as ...Page SetupPrintI chose Save Results as ...which brings up a dialog to save a CSV file, I save it, opened it in EXCEL, then change the date column to m/d/yyyy h:mm:ssIt shows as '07/25/2013 00:00:00' Is that what you did? |
 |
|
tjonas
Starting Member
17 Posts |
Posted - 2014-08-14 : 15:18:34
|
quote: Originally posted by gbritton I don't think that's in standard SSMS. I Only see:CopyCopy with HeadersSelect AllSave Results as ...Page SetupPrintI chose Save Results as ...which brings up a dialog to save a CSV file, I save it, opened it in EXCEL, then change the date column to m/d/yyyy h:mm:ssIt shows as '07/25/2013 00:00:00' Is that what you did?
No, I exported as xls. It will not let me change in excel |
 |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-14 : 15:46:56
|
You must have some add-on to let you export directly to Excel. |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2014-08-15 : 02:20:56
|
Use powershell to export the date \ data . That way you can manage the format for the input and how it's written to excel. See some example here:http://www.sqlserver-dba.com/2013/05/sql-server-export-to-excel-with-powershell.htmlAnother alternative to explore us Import from ExcelJack Vamvas--------------------http://www.sqlserver-dba.com |
 |
|
|
|
|