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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Losing date when saving result set in Excel

Author  Topic 

Lsql
Starting Member

1 Post

Posted - 2010-08-09 : 09:02:55
My results set included datetime2 fields but when I copied the results to an EXCEL file I lost the Date - I only had the Time showing. I used a CAST function in my Select statement to remove the time and that was successfully saved to EXCEL. I'm curious to understand how I lost the Date information before and whether there is a more efficient way of resolving this particularly when I need both date and time in the future. Thanks

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-08-09 : 09:09:00
You didn't lose it. After pasting, reformat the date column and everything should be there. In Excel I usually custom format dates as "mm/dd/yyyy"

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -