StartDriver.EffectiveDateDifference Property (Project)

Gets the duration between two dates in minutes, using the effective calendar for a manually scheduled task. Read-only Long.

Version Information

Version Added: Project 2010

Syntax

expression .EffectiveDateDifference(StartDate, FinishDate)

expression An expression that returns a StartDriver object.

Parameters

Name

Required/Optional

Data Type

Description

StartDate

Required

Variant

Arbitrary start date and time, for example, "7/10/2010" or "7/10/2010 2:00:00 PM".

FinishDate

Required

Variant

Arbitrary finish date and time.

Remarks

The EffectiveDateDifference property uses the effective calendar for manually scheduled tasks, which allows tasks to start and finish on non-working times. The StartDate and FinishDate arguments can be arbitrary dates. The property and arguments do not affect the task dates.

You can use the EffectiveDateSubtract, EffectiveDateAdd, and EffectiveDateDifference properties to calculate start and finish dates for manually scheduled tasks.

To calculate the date difference for an automatically scheduled task, where you can also specify the calendar, use the DateDifference method.

Example

The following statement returns the value 480, which shows that the finish date is 8 hours of working time after the start date.

Debug.Print ActiveProject.Tasks(3).StartDriver.EffectiveDateDifference("7/1/2009 3:00:00 PM", "7/2/2009 3:00:00 PM")

The following statement returns the value -840, which shows that the finish date is 14 hours of working time before the start date.

Debug.Print ActiveProject.Tasks(3).StartDriver.EffectiveDateDifference("7/1/2009 3:00:00 PM", "6/30/2009 8:00:00 AM")