简体   繁体   中英

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.

When I use =Fields!DateTime.Value , I display the date like this (it's only example).

示例照片

But I want to display it in this way (date is ok) 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...

=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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM