Reporting services SSRS-hh:mm:ss tt显示为;hh:mm:ss tt";而不是实际时间

Reporting services SSRS-hh:mm:ss tt显示为;hh:mm:ss tt";而不是实际时间,reporting-services,report,ssrs-2008,Reporting Services,Report,Ssrs 2008,对于报告和所有内容来说仍然非常新,目前正在尝试修改报告的时间格式,我希望它显示为(例如)02:30:05 PM,而不是当前/默认的14:30:05 以下是我目前掌握的情况: ="between the hours of " & Format(Parameters!StartTime.Value, "hh:mm:ss tt") & " and " & Format(Parameters!EndTime.Value, "hh:mm:ss tt") & " (" &am

对于报告和所有内容来说仍然非常新,目前正在尝试修改报告的时间格式,我希望它显示为(例如)02:30:05 PM,而不是当前/默认的14:30:05

以下是我目前掌握的情况:

="between the hours of " & Format(Parameters!StartTime.Value, "hh:mm:ss tt") & " and " & Format(Parameters!EndTime.Value, "hh:mm:ss tt") & " (" & Parameters!TimeZone.Label & ")"
问题是,运行报告时,它显示为“在hh:mm:ss tt和hh:mm:ss tt之间”,而不是“在下午02:30:05和03:30:05之间”


你知道为什么会这样吗?谢谢大家!

您的参数的数据类型似乎导致了这种情况。您当前很可能将其设置为
Text
。在参数属性中,将其更改为
Date/Time
。这将允许
Format
函数将其解释为日期和时间,而不是字符串

或者,可以在表达式中将参数值强制转换为日期,如下所示:

Format(CDate(Parameters!StartTime.Value), "hh:mm:ss tt")

使用了第二种方法,效果很好-谢谢!