Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How do you properly export time values to Excel? Expand / Collapse
Author
Message
Posted Tuesday, September 24, 2013 7:52 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, June 20, 2014 8:23 AM
Points: 738, Visits: 1,305
My users wanted to have the date/time field in a table split into the date part and the time part. I thought that the TimeValue() function would do the job, and it appeared to, at least within the report. However, when exporting it to Excel the time value is awful. It's some huge negative number with the time value there. I've read somewhere (can't remember where, sorry) that the TimeValue() function puts the date part of the datetime to some date way in the past, and that's how it doesn't get displayed in the report. But man, does that play havoc when exporting to Excel! The same place where I saw that article also said that you could "fix" that by changing the base date for the spreadsheet in Excel to something like 1/1/1903. Believe me, my users aren't that sophisticated. They don't want to have to do anything like that, and certainly have no idea as to how to do that, but they demand that the exported Excel spreadsheet will be in the correct time format, and that that column be sortable. So how do I resolve this problem?

Right now we're using SSRS 2005, but in 2 weeks we'll install SQL Server 2012, so will that take care of it?


Kindest Regards,

Rod
Connect with me on LinkedIn.
Post #1497865
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse