Show time tag in SSRS Parameter

℡╲_俬逩灬. 提交于 2019-12-11 08:19:02

问题


I have an SSRS report with two parameters: StartTime and EndTime. I have default values on the parameters to be set as the current date at 12:00am and the previous day at 12:00am.

However, since 12am is the default time on SSRS, it will not show in the parameter selection. What you see is, for example, '9/29/2011'. If there were to be a time other than 12:00am, you would see '9/29/2011 12:45:00.' Is it possible to get the report parameters to populate at 12am and still show the time? The reason I want this is because, although I know that it's possible to set a time, those using the report may assume you can only choose the date.

I feel like I did a pretty bad job explaining this. Here is a picture of what I have and what I want. I modified the EndTime to look like how I want it to look (by typing it in after the report was ran)


回答1:


I just tested this in SSRS 2008R2 BIDS: If I add a millisecond to the datetime, you'll get the time displayed as you want. I.E. set the default value to:

=DateTime.Parse("October 2, 2011, 12:00:00.001")

If this millisecond causes you problems elsewhere in the report, then test for this value and subtract a millisecond back out.



来源:https://stackoverflow.com/questions/7615090/show-time-tag-in-ssrs-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!