0

I am working with SSRS 2008. I am needing to format the date time. I am currently using this expression

 =FormatDateTime(Parameters!startdate.Value) 

the output of this expression is

1/22/2014 6:00:00 am. 

I would like it to say just

1/22/2014

What would i need to do to this expression to make the output look this way? Thanks in advance.

Fozzy767
  • 83
  • 2
  • 2
  • 6

2 Answers2

6

try something like

=Format(Parameters!startdate.Value,"dd/MM/yyyy")
M.Ali
  • 67,945
  • 13
  • 101
  • 127
3

You should use the Format property of the Textbox for this and format data in the expression only as a last resort. Select the textbox and look for Format in the property window. There you can enter the format string like dd/MM/yyyy without quotes.

That will keep your expression clean (in fact, you won't need an expression at all) and as an added bonus will allow exporting the value to excel as a datetime so you won't get datetime format conflicts later.

If your datetime is only a part of the text, you can even create a placeholder and put the format on that placeholder. Example textbox: The time is [@startdate]. When you enter this, [@startdate] becomes a placeholder with your parameter and you can select it and set a format on it. No expressions needed.

H B
  • 701
  • 6
  • 9