如何在SSRS中仅使用表达式显示Datepart?

时间:2015-06-26 06:56:19

标签: sql sql-server reporting-services ssrs-2008 ssrs-2008-r2

我需要在SSRS报告中忽略Datepart(6/26/2000),才能在报告中仅显示Time。我已经从数据集输出列datetime

获取Startdate

使用表达式

=First(Fields!start_dte_display.Value, "Salesvalue")

SalesValue ==>数据集名称

输出我从上面的表达式

6/26/2000 12:00:00 AM

我的预期输出

6/26/2000 

请帮我输出!!

2 个答案:

答案 0 :(得分:3)

尝试格式化:

=Format(First(Fields!start_dte_display.Value, "Salesvalue"), "MM/dd/yyyy")

注意:MM必须是大写的,mm会给你几分钟!

答案 1 :(得分:2)

You can use Text-box properties to set the date format as you want to show on the report. Just you need to right click on the text-box and choose Text Box Properties. In the Text Box Properties window you can choose Number > Date and date sample as 1/31/2000 and click on the Ok button.

Another simple way to set the Text Box Format = M/d/yyyy in properties window.