Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you reformat date parameter values in Reporting Services?

Is it possible to transform the format of a date value that is passed to the query? I am trying to create a report that interfaces with a SAP back-end, but the query uses a different format for date objects. I need to take the selected date and reformat it to "yyyy.mm.dd" (including the quotes). Is this possible? I can do it as a textbox, but this is a bit ugly. Any advice would be appreciated.

like image 293
tsimon Avatar asked Sep 06 '25 14:09

tsimon


1 Answers

As the parameter is passed to your sql in the dataset of your report, you can change the expression. For example, this is the default code

=Parameters!StartDate.Value

You can change it to, basically the expression is like vb code

="""" + Year(Parameters!StartDate.Value).ToString() + "." + Month(Parameters!StartDate.Value).ToString() + "." + Day(Parameters!StartDate.Value).ToString() + """"
like image 176
user31269 Avatar answered Sep 10 '25 06:09

user31269