Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.DateSubtract Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Returns the date and time that precedes another date by a specified duration, for an automatically scheduled task.

Syntax

expression. DateSubtract( ** FinishDate, ** Duration, ** Calendar** )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
FinishDateRequiredVariantThe date used as the end of the duration.
DurationRequiredVariantThe duration to subtract from the finish date.
CalendarOptionalObjectA resource, task, or base calendar object. The default value is the calendar of the active project.

Return Value

Variant

Remarks

To subtract a duration from a date for a manually scheduled task, which uses an effective calendar that can include non-working time, use the EffectiveDateSubtract property.

Example

The following example displays the start date of a task that lasts three days and ends on 7/13/02 at 5:00 P.M.

Sub FindDuration() 
 MsgBox DateSubtract("7/13/02 5:00 PM", "3d") 
End Sub
© 2017 Microsoft