Now 函數

套用到
Microsoft 365 Access Access 2024 Access 2021 Access 2019 Access 2016

會根據您公司系統日期和時間,傳回指定目前日期和時間的 Variant (Date)。

語法

Now

查詢範例

運算式 結果
現在 () 選擇 ProductSales GROUP 的 Expr1 () ; 回傳目前系統的「Date and Time」預設時間格式,並顯示在 Expr1 欄位。
立即選擇 立即 () 為 CurrentDate and Time FROM ProductSales GROUP BY Now () ; 回傳預設系統時間格式的當前系統「Date and Time」,並在欄位 CurrentDateandTime 顯示。

VBA 範例

注意

下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。

此範例使用 Now 函式回傳當前系統日期與時間。

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

選擇合適的約會功能