StartDriver.EffectiveDateDifference property (Project)

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

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 don't affect the task dates.

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")

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.