简体   繁体   中英

How do I display todays date on SSRS report?

I want to show up Todays date as report generated date on SSRS report.

How can i do that?

should I use any variable?

please help me I'm newbie to SSRS.

For example refer this image:在此处输入图像描述

日期列 1:

=formatdatetime(today)

Try this:

=FORMAT(Cdate(today), "dd-MM-yyyy")

or

=FORMAT(Cdate(today), "MM-dd-yyyy")

or

=FORMAT(Cdate(today), "yyyy-MM-dd")

or

=Report Generation Date: " & FORMAT(Cdate(today), "dd-MM-yyyy")

You should format the date in the same format your customer (internal or external) wants to see the date . For example In one of my servers it is running on American date format (MM-dd-yyyy) and on my reports I must ensure the dates displayed are European (yyyy-MM-dd).

您还可以从内置字段列表中拖放“执行时间”项目。

要显示日期和时间,请尝试以下操作:

=Format(Now(), "dd/MM/yyyy hh:mm tt")

您可以在报告中放置一个文本框,并在其中添加具有以下值的表达式:

="Report generation date:  " & Format(Globals!ExecutionTime,"dd/MM/yyyy  h:mm:ss tt" )

In the text box that contains the header, you can use an expression to get the date. Try something like

    ="Report Generation Date: " & Today()

right click in the text box in the layout view. At the bottom of the list you'll see the expression option. There you will be able to enter the code. This option will allow you to avoid adding a second textbox.

Just simple use

=Format(today(), "dd/MM/yyyy")

will solve your problem.

  1. Inset Test box in the design area of the SSRS report.
  2. Right-click on the Textbox and scroll down and click on the Expression tab
  3. just type the given expression in the expression area: =format(Today,"dd/MM/yyyy")

you may use the build-in function

Globals!ExecutionTime

You can use built in function =Globals!ExecutionTime and make the value = [&ExecutionTime] (or whatever you want to call it)

You can also add the user Id of the person generating the report using the built in function

=User!UserID

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