Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.
從日期和時間值加上或減去

下表列出使用 DateAdd 函數來新增日期和時間值的表示式範例。

您可以在表單報表或查詢條件資料列的計算控制項中使用這些運算式。

運算式

描述

=DateAdd (“d”, -10, [承諾日期])

顯示 [承諾日期] 欄位值前 10 天的日期。

=DateAdd (“m”, 1, “31-Jan-13”)

顯示 31-Jan-03 之後的一個月日期,因此表達式會評估為 28-Feb-03。

=DateAdd (“m”, 1, “31-Jan-04”)

顯示 31-Jan-04 之後的月份日期,而由於 2004 年是閏年,表達式會評估為 29-Feb-04。

=DateAdd (“q”, 3, [承諾日期])

顯示的日期會比 [承諾日期] 字段的值後面三季;例如,如果[承諾日期] 字段的值為 18-Jun-03,表達式會評估為 18-Mar-04。

=DateAdd (“h”, 3, [ArrivalTime])

顯示 [送達時間] 字段值后 3 小時的時間。

您可以在查詢的匯出欄位中使用這些表示式。

運算式

描述

DueDate:DateAdd (“q”, 3, [承諾Date])

在 DueDate 欄位中顯示的日期會比 [承諾日期] 字段的值後面三季。

PickUpTime:DateAdd (“h”, 3, [ArrivalTime])

在 PickUpTime 欄位中顯示一個比 [送達時間] 字段值后 3 小時的時間。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×