How to remove the time and Display the Date only in RDLC

给你一囗甜甜゛ 提交于 2019-12-06 21:52:20

问题


all I am using Winform(C#) and RDLC MySQL. In that I try to show the date only in Tablex.

But this date format have time also. How to remove the time.

My Expression is,..

=Fields!date.Value

See my report below.

Thanks in advance?

I am tried =Fields!date.Value.ToString("dd/MM/yyyy") in expression But It through error,.. Error 1 An error occurred while validating. HRESULT = '8000000A'


回答1:


You can use the FormatDateTime method:

=FormatDateTime(Fields!date.Value, DateFormat.ShortDate)

Or you can set the formatting in the properties window:




回答2:


="Current Date:-"&Format(Now,"dd/MM/yyyy hh:mm tt") this is for current date and time




回答3:


This worked for me:

=FormatDateTime(Now(), DateFormat.ShortDate)



回答4:


=FormatDateTime(Fields!dtStamp.Value, DateFormat.ShortDate)

The image shows the working of dateFormat.




回答5:


formate(Fields!date.Value,"dd/MM/yyyy")



来源:https://stackoverflow.com/questions/9140630/how-to-remove-the-time-and-display-the-date-only-in-rdlc

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