Now 函数

应用对象
Microsoft 365 专属 Access Access 2024 Access 2021 Access 2019 Access 2016

返回一个 Variant (Date) 值,根据计算机的系统日期和时间指定当前的日期和时间。

语法

Now

查询示例

Expression 结果
SELECT Now () AS Expr1 FROM ProductSales GROUP BY Now () ; 以默认系统时间格式返回当前系统“日期和时间”,并显示在 Expr1 列中。
SELECT Now () AS CurrentDateandTime FROM ProductSales GROUP BY Now () ; 以默认系统时间格式返回当前系统“日期和时间”,并显示在 CurrentDateandTime 列中。

VBA 示例

注意

下面的示例演示了如何在 Visual Basic for Applications (VBA) 模块中使用此函数。 有关使用 VBA 的详细信息,请在搜索旁边的下拉列表中选择“开发人员参考”,并在搜索框中输入一个或多个术语。

此示例使用 Now 函数返回当前系统日期和时间。

Dim Today
Today = Now    ' Assign current system date and time.

选择正确的日期函数