April 23, 2012 at 2:28 am
I've got a datetime field in SQL which is being pulled into a report.
Setting a custom format of dd-MMM-yy makes the date display fine, exporting to Excel means it's still recognised as a date too, however, it appends the time portion to the field too, this causes problems for users who need to perform calculations on the dates.
So, select CONVERT(date, getdate()) for example gives you just a date in SQL - 2012-04-23, however, in SSRS it still exports to Excel with a timestamp too!
Any of the formats to remove the time stamp seem to basically be converting the field to a string, meaning Excel doesn't detect it as a date and hence we're no better off.
I'm not especially bothered by the format (dd-MMM-yy would be nice though), but I just want a way I can have dates which still ARE date fields without the timestamp. It seems even if you do this in the tSQL that SSRS overrides it.
Does anyone have any thoughts on this (is is possible?!) or any handy tips?
Thanks.
April 23, 2012 at 2:45 am
you could use the FORMAT command in an expression on the field
FORMAT(Fields!DateField.Value, "dd-MMM-yy")
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply