×
英语
很抱歉。本文没有你的语言版本。
Add to or subtract from date and time values

Add to or subtract from date and time values

The following table lists examples of expressions that use the DateAdd function to add date and time values.

You can use these expressions in calculated controls on forms reports, or in query criteria rows.

Expression

Description

=DateAdd("d", -10, [PromisedDate])

Displays a date that is 10 days before the value of the PromisedDate field.

=DateAdd("m", 1, "31-Jan-13")

Displays a date that is a month after 31-Jan-03, so the expression will evaluate to 28-Feb-03.

=DateAdd("m", 1, "31-Jan-04")

Displays a date that is a month after 31-Jan-04, and since 2004 is a leap year, the expression will evaluate to 29-Feb-04.

=DateAdd("q", 3, [PromisedDate])

Displays a date that is three quarters after the value of the PromisedDate field; for example, if the value of the PromisedDate field is 18-Jun-03, the expression will evaluate to 18-Mar-04.

=DateAdd("h", 3, [ArrivalTime])

Displays a time that is three hours after the value of the ArrivalTime field.

You can use these expressions in a calculated field in a query.

Expression

Description

DueDate: DateAdd("q", 3, [PromisedDate])

Displays in the DueDate field a date that is three quarters after the value of the PromisedDate field.

PickUpTime: DateAdd("h", 3, [ArrivalTime])

Displays in the PickUpTime field a time that is three hours after the value of the ArrivalTime field.

扩展你的 Office 技能
了解培训
抢先获得新功能
加入 Office 预览体验计划

此信息是否有帮助?

谢谢您的反馈!

谢谢你的反馈! 可能需要转接到 Office 支持专员。

×