Take the 2-minute tour ×

We have an SSRS report on which we want to show a date field in the following format DD-MMM-YY like in Oracle. That converts dates to 25-Jan-11

So in the SQL that does the final select, we use Replace (CONVERT (VarChar, DateTimeColumn,106), ' ', '-')

Is there a better way of doing this conversion?

share|improve this question

1 Answer 1

Within SQL Server

SQL Server CONVERT: http://msdn.microsoft.com/en-us/library/ms187928.aspx

No, that specific format is not available so what you are doing is what there is. I normally prefer to size varchar columns instead of leaving it unsized.

I also notice you have 106, which is DD-MMM-YYYY not DD-MMM-YY. Did you mean to use 6?

REPLACE(CONVERT (varchar(9), DateTimeColumn, 6), ' ', '-')

Using SSRS formatting

=Format(Fields!DateTimeColumn.Value, “dd-MMM-yy”)
share|improve this answer
Yes, personally I'd bring the value back from SQL Server as a datetime and then format it in the report. You don't even need to use an explicit expression -- just set the "Format" property of the cell to dd-MMM-yy in the Properties pane. –  Matt Gibson Jan 26 '11 at 11:48

Your Answer


