简体   繁体   English

SQL Reporting Services 2005使用DateSerial函数向用户显示午夜的默认时间

[英]SQL Reporting Services 2005 Display default time of midnight to user using DateSerial Function

Im currently working on a report in SQL 2005 and am pretty new to reports. 我目前正在编写SQL 2005中的报告,对于报告来说还是一个新手。 I am using a "Start Date" and "End Date" for a user to select a reporting period. 我正在使用“开始日期”和“结束日期”供用户选择报告期间。

For my "Start Date" I am using a Report Parameter "Default" value of: 对于我的“开始日期”,我使用报告参数“默认”值:

=DateSerial(Year(Today()),Month(Today()),Day(Today())) = DateSerial(年(TODAY()),月(TODAY()),日(TODAY()))

For my "End Date" I am using a ReportParameter Defulat value of: 对于我的“结束日期”,我使用的是ReportParameter Defulat值:

=Now() 现在=()

The user is displayed the following: 用户显示以下内容:

  • Start Date: 06/01/2012 开课日期:06/01/2012
  • End Date: 01/01/2012 12:33:03 结束日期:01/01/2012 12:33:03

PROBLEM: - I would like to DISPLAY the default time from the DateSerial function to the user (which is defaulted to midnight 00:00:00). 问题: - 我想显示从DateSerial函数到用户的默认时间(默认为午夜00:00:00)。 Im just curious if this is possible in SQL 2005. 我只是好奇,如果在SQL 2005中这是可能的。

If time is not relevant to your query (eg the data you are querying only uses dates and not time) the 'End Date' parameter default could be changed to "=Today()" 如果时间与您的查询无关(例如,您查询的数据仅使用日期而非时间),则“结束日期”参数默认值可以更改为“=今天()”

The "Today()" function provides the current date only, if used in a type that supports time as well, the 'default' time of 12:00:00 AM will be show. “Today()”函数仅提供当前日期,如果在支持时间的类型中使用,则将显示12:00的默认时间。

Expression Examples (Report Builder and SSRS) 表达示例(Report Builder和SSRS)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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