SSRS 第二函数

SSRS 第二函数是一个日期和时间函数,它从给定的日期时间中提取分钟的秒数,并返回一个从 0 到 59 的整数。Second 函数从日期和时间中提取秒数的语法如下所示。

=Second(Fields!OrderDate.Value)

为了演示 Second 函数,我们使用下面有 15 条记录的 Employee 表。图片显示了 Table 报表中的记录。

Source Table

SSRS Second 函数示例

为此,我将在 Hire Date 列的右侧添加一个新列,并将其命名为 Seconds。接下来,右键单击 Second 下方的文本框,然后选择 Expression。为了理解该报表,我建议您参考 SSRS 中关于 图表表格分组格式化表格 的文章。

这将打开以下表达式窗口来打印秒数。下面的 Second 函数从 HireDate 列中提取 Seconds 值,并为每位员工返回一个从 0 到 59 的整数值。

=Second(Fields!HireDate.Value)
Function return the Seconds of the minute from the date and time field

请点击预览选项卡查看报表。如需更多函数 >> 点击此处!

SSRS Second Function to return the Seconds of the minute from the date and time field preview