[英]SSRS reporting report designer
I have a problem with times conversion. 我对时间转换有疑问。 In my database, I have
2018-08-20 08:30:11.000 PM
and I can't change this format. 在我的数据库中,我有
2018-08-20 08:30:11.000 PM
,我无法更改此格式。
When I use =Fields!DateTime.Value
, I display the date like this (it's only example). 当我使用
=Fields!DateTime.Value
,我这样显示日期(这只是示例)。
But I want to display it in this way (date is ok) 2018-08-20 20:30:11
. 但我想以这种方式显示它(日期确定)
2018-08-20 20:30:11
。 I thought about searching this value and when it will be PM then add 12 to hour but it doesnt work... I have no more ideas... 我考虑过搜索该值,何时将其作为下午,然后将12添加到小时,但它不起作用...我没有更多的想法...
=Format(Fields!DateTime.Value,"MM/dd/yyyy") & Environment.NewLine & iif (Fields!DateTimeValue="PM"), Format(Fields!DtTmStart.Value="HH+12:mm:ss")
Could somebody help me? 有人可以帮我吗? Please!
请!
The following expression should give you what you need... 以下表达式将为您提供所需的信息...
=Format(Fields!DateTime.Value,"yyyy/MM/dd HH:mm:ss")
Note the upper case HH, this gives 24 hour format (hh = 12 hour format) 请注意大写字母HH,这给出了24小时格式(hh = 12小时格式)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.