How do you properly export time values to Excel?

  • 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.

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply